mindspore.Tensor.size

查看源文件
mindspore.Tensor.size()

详情请参考 mindspore.ops.size()

样例:

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