Skip to content

The problem about EmbeddingBag module #1864

@santisy

Description

@santisy

Code as below:

import torch
from torch.autograd import Variable
import torch.nn as nn

a = Variable(torch.LongTensor(2, 2).fill_(1).cuda())
embedding_bag = nn.EmbeddingBag(2, 10)
embedding_bag(a)

raised an AttributeError

It seems https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/sparse.py#L200 should be offsets = input.data.new(input.size(0)).fill_(input.size(1))?
I build from source with commit 67968cb. python 2.7, cuda 8.0, cudnn 6

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