Skip to content

Commit

Permalink
fix EmbeddingSum offsets initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith authored Jul 13, 2017
1 parent 1e98155 commit 20ce45b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/nn/modules/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def forward(self, input, offsets=None):
" fixed length sequences. However, found "
"offsets of type {}".format(type(offsets)))
else:
offsets = input.new(input.size(0)).fill_(input.size(1))
offsets = input.data.new(input.size(0)).fill_(input.size(1))
elif input.dim() != 1:
raise ValueError("input has to be 1D or 2D Tensor,"
" but got Tensor of dimension {}".format(input.dim()))
Expand Down

0 comments on commit 20ce45b

Please sign in to comment.