【发布时间】:2021-04-03 08:04:35
【问题描述】:
我是火炬新手。
当我学习下面这样的手电筒教程时,
我很好奇 tensor.item() 是在哪里定义的。
import torch
a = torch.tensor([1])
print( a.item() ) # it works without problem.
为了找到我不知道的东西,
首先,我使用了 VScode。但我明白了。
enter image description here
不喜欢这样
enter image description here
第二,我在the torch Github搜索了“def item()”
但是,我找不到。 T^T
你能告诉我tensor.item()在哪里定义the Github吗?
或者
Class_torch.tensor's Menber functions(Method function) 是在哪里定义的??
【问题讨论】: