【发布时间】:2020-11-08 11:53:38
【问题描述】:
您好,我有以下代码:
import torch
x = torch.zeros(1,8,4,576) # create a 4 dimensional tensor
x[0,4,2,333] = 1.0 # put on 1 on a random spot
# I want to find the index of the highest value (0,4,2,333)
print(x.argmax()) # this should return the index
返回
张量(10701)
这个 10701 有什么意义?
如何获得实际索引 0,4,2,333?
【问题讨论】:
标签: pytorch torch torchvision