megengine.core.tensor.array_method.ArrayMethodMixin.tolist

ArrayMethodMixin.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.

This operation is not differentiable.