torch.max()
1.
torch.max()简单来说是返回一个tensor中的最大值。
例如:
>>> si=torch.randn(4,5)
>>> print(si)
tensor([[ 1.1659, -1.5195, 0.0455, 1.7610, -0.2064],
[-0.3443, 2.0483, 0.6303, 0.9475, 0.4364],
[-1.5268, -1.0833, 1.6847, 0.0145, -0.2088],
[-0.8681, 0.1516, -0.7764, 0.8244, -1.2194]])
>>> print(
- 1
- 2
前往页