How to return the index of max and compute acc in C++

Hi, all

I would like to get maximum index from output 64 by 10 and compare with ground truth y with size 64 by 1 to obtain accuracy in libtorch c++.
It seems max only return max value not index.
How shall I do that please ?
Thanks.

torch::argmax should work and would give you the indices for the corresponding max. values.

Thank you for your comments.

Much appreciated.