megengine.Tensor.item

Tensor.item(*args)

Returns the value of this Tensor as a standard Python numbers.Number. This only works for tensors with one element. For other cases, see tolist.