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

[Bug Fix] numericalize doesn't create cuda tensor #302

Merged
merged 1 commit into from May 3, 2018

Conversation

zshihang
Copy link
Contributor

the fixes to pytorch 0.4 compatibility issues stop creating cuda tensor due to:

self.tensor_type(arr, device=device)

tensor_type is torch.LongTensor by default which doesn't accept a device argument. as suggested by migration guide, i change it to torch.tensor for numericalization.

pytorch 0.4 also decouples type, device, layout from creation of tensors. i changed tensor_type to dtype, because the tensor_type like torch.LongTensor explicitly creates a CPU dense tensor of type long, which means more than just a type.

@zshihang
Copy link
Contributor Author

#304

@dolphin-zs
Copy link

Good fix! I also encounter the same problem. Wish to see the update.

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

Successfully merging this pull request may close these issues.

None yet

4 participants