what about argmax from the tensor itself like:
import torch

x = torch.randn(3)
x.argmax(-1)

meta:
- where does one find the docs for this? googling takes you to the torch.argmax function and not the one for tensors…ans: seems this is where it is: https://pytorch.org/docs/stable/tensors.html 63

probably useful:

Calculating accuracy of the current minibatch? 7
https://stackoverflow.com/questions/51503851/calculate-the-accuracy-every-epoch-in-pytorch 2
https://towardsdatascience.com/understanding-dimensions-in-pytorch-6edf9972d3be 3
How does one get the predicted classification label from a pytorch model? 6