Hi,
Your script works fine for me. I’m having trouble creating a self-contained script to reproduce the issue because the array in my example is the output of a network, but if I generate a tensor using torch.randn() and move it to my GPU then .argmax() works fine.
As far as I can tell, this issue only happens when the true maximum value is in the second half of the tensor (index 75 and onwards of a 151 element tensor).
I understand this is very hard to help with when I can’t provide a self-contained example, but any suggestions of how I could investigate on my side are much appreciated!