Input data is looking this:
tensor([[-1.0000, -1.0000, -1.0000,  …, -0.1132, -1.0000, -1.0000],
[-1.0000, -1.0000, -1.0000,  …, -0.1253, -1.0000, -1.0000],
[-1.0000, -1.0000, -1.0000,  …, -0.1316, -1.0000, -1.0000],
…,
[-1.0000, -1.0000, -1.0000,  …, -0.1269, -1.0000, -1.0000],
[-1.0000, -1.0000, -1.0000,  …, -0.1322, -1.0000, -1.0000],
[-1.0000, -1.0000, -1.0000,  …, -0.1047, -1.0000, -1.0000]],
device=‘cuda:0’)
data = self.embeddingd(data)
File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 1051, in _call_impl
return forward_call(*input, **kwargs)
File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/nn/modules/sparse.py”, line 160, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py”, line 2043, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 ‘indices’ to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)
I am having this error too. Please help me on this.