Skip to content

nn.EmbeddingBag doesn't seem to support None offset for 2D tensors #3326

@antoinelb

Description

@antoinelb

Example

import torch
from torch import nn
from torch.autograd import Variable
a = Variable(torch.LongTensor([[1, 0, 2], [2, 1, 0], [0, 0, 1]]))
embed = nn.EmbeddingBag(3, 4)
embed(a)

Gives
RuntimeError: expected a Variable argument, but got torch.LongTensor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions