I have a 4D tensor, and I would like to get the argmax across the last two dimensions. torch.argmax only accepts integers as the "dim" argument, not tuples.
How can I accomplish this?
Here's what I had in mind, but I can't figure out how to match up the dimensions of my two "indices" tensors. original_array is shape [1, 512, 37, 59].
max_vals, indices_r = torch.max(original_array, dim=2)
max_vals, indices_c = torch.max(max_vals, dim=2)
indices = torch.hstack((indices_r, indices_c))