mindspore.Tensor.nbytes

property mindspore.Tensor.nbytes

返回Tensor占用的总字节数。

样例:

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