megengine.Tensor.item#

Tensor.item(*args)#

以标准 Python numbers.Number 的形式返回此 Tensor 的值。此方法只能在含有一个元素的 Tensor 上使用。对于其它情况,请参见 tolist.