Hello,
I am starting to use pytorch and I have a problem when I try to convert the return of torch::argmax to an int in pytorch c++.
For instance:
auto arrayCpu = torch::randint(1, 10, 10);
auto max = torch::argmax(arrayCpu);
auto maxNumber = *max.data<int>();
Error:
terminate called after throwing an instance of ‘c10::Error’
what(): expected scalar type Int but found Long (data at …
Thanks for any help!