mindspore.Tensor.itemsize

property Tensor.itemsize

Return the length of one tensor element in bytes.

Examples

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