import torch
x = torch.rand(3,4)
print('x:\n',x)
print('torch.max(x,1):\n',torch.max(x,1))
print('torch.max(x,0):\n',torch.max(x,0))
print('torch.max(x,1)[0]:\n',torch.max(x,1)[0])
print('torch.max(x,1)[1]:\n',torch.max(x,1)[1])
print('torch.max(x,1)[1].data:\n',torch.max(x,1)[1].data)
print('torch.max(x,1)[1].data.numpy():\n',torch.max(x,1)[1].data.numpy())
print('torch.max(x,1)[1].data.numpy().squeeze():\n',torch.max(x,1)[1].data.numpy().squeeze())
print('torch.max(x,1)[0].data:\n',torch.max(x,1)[0].data)
print('torch.max(x,1)[0].data.numpy():\n',torch.max(x,1)[0].data.numpy())
print('torch.max(x,1)[0].data.numpy().squeeze():\n',torch.max(x,1)[0].data.numpy().squeeze())
torch.max()备忘
最新推荐文章于 2024-02-09 23:37:29 发布