Python API
Tensor.
tolist
Returns the tensor as a (nested) list. For scalars, a standard Python number is returned, just like with item. Tensors are automatically moved to the CPU first if necessary.
item
This operation is not differentiable.