pytorch 中 argmax(1) 是什么意思?

pytorch 中 argmax(1) 是什么意思?

示例

import torch
print(torch.tensor([[1,2,3,4,5],[100,3,4,5,6]]).argmax(1)) 
tensor([4, 0])

解释

image

posted @ 2025-12-30 09:43  fanbal  阅读(4)  评论(0)    收藏  举报