How to get 2D index of maximum value of 2D tensor?

as the title shows , it would be better to provide code.
Thanks!

You could use (assuming A is the tensor)

idx = A.argmax()
x, y = idx//A.shape[1], idx%A.shape[1]