Skip to content

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

Open
@JinTonic101

Description

@JinTonic101

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 !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions