mindspore.Tensor.nbytes

property Tensor.nbytes

Return the total number of bytes taken by the tensor.

Examples

>>> from mindspore import Tensor
>>> import numpy as np
>>> x = Tensor(np.array([[1, 2], [3, 4]]))
>>> output = x.nbytes
>>> print(output)
32