In python list, we can use list.index(somevalue)
. How can pytorch do this?
For example:
a=[1,2,3]
print(a.index(2))
Then, 1
will be output. How can a pytorch tensor do this without converting it to a python list?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…