>>> import torch
>>> i=torch.Tensor([[1, 1, 0, 1],
[0, 1, 1, 1],
[0, 1, 0, 1]])
>>> i.size()
torch.Size([3, 4])
>>> c=torch.max(i,dim=1)
>>> c
torch.return_types.max(
values=tensor([1., 1., 1.]),
indices=tensor([0, 1, 1]))
>>> c=torch.max(i,dim=1)[1]
>>> c
tensor([0, 1, 1])
#最终结果就是返回最大值的索引值