Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuda.LongTensor instead of LongTensor on GPU #156

Closed
ShilinHe opened this issue Aug 13, 2018 · 5 comments
Closed

Cuda.LongTensor instead of LongTensor on GPU #156

ShilinHe opened this issue Aug 13, 2018 · 5 comments

Comments

@ShilinHe
Copy link

I found this bug when running the basic script, example/sample.py:

return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'

It seems to be a wrong type of tensor on GPU.

@pskrunner14
Copy link

@ShilinHe can you provide the complete log? Seems like the tensor is'nt being assigned to cuda.

@cailurus
Copy link

same

@pskrunner14
Copy link

pskrunner14 commented Aug 31, 2018

@ShilinHe this has been fixed in #161.

@ShilinHe
Copy link
Author

ShilinHe commented Sep 3, 2018

So sorry for the late reply, Thanks for your work!

@ShilinHe ShilinHe closed this as completed Sep 3, 2018
@DavidLKing
Copy link

Heads up, I'm getting the same errors after a fresh clone. I've been manually adding if torch.cuda.is_available(): VARIABLE.cuda() entries to get around it temporarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants