The LongTensor that specifies the argmax values is only returned when a dimension is specified.
a = torch.randn(1,3)
# tensor([[-0.6392, -0.8940,  0.3799]])
torch.max(a, dim=0) 
#  (tensor([-0.6392, -0.8940,  0.3799]), tensor([ 0,  0,  0]))
torch.max(a, dim=1) 
# (tensor([ 0.3799]), tensor([ 2]))

I think the returned LongTensor always has 1 fewer dimension than the input tensor. Without specifying which dimension in which to get the max values, torch won’t know which LongTensor to return. When the dimension isn’t specified, the singular maximal value in the entire tensor will be returned (as a single element tensor). Such as:
b = torch.randn(4,4)
torch.max(b)
# tensor(1.2384)