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

"Error: Expected tensor for argument #1 'indices' to have scalar type Long; but got CPUFloatType instead" #4

Open
JinTonic101 opened this issue Mar 2, 2020 · 0 comments

Comments

@JinTonic101
Copy link

Hi @vvmnnnkv

So as discussed before, the lib only supports float tensors and it can only converts back to JS as Uint8 array atm. It could be great to expose more types/functions and make it more generic.

In C++ I've managed to fix the issue by changing the input tensor type to 'kLong':
torch::jit::IValue input = torch::from_blob(data, shape, torch::TensorOptions().dtype(torch::kLong))

Thank you in advance and let me know if I can help in any way !

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

No branches or pull requests

1 participant