mindspore.Tensor.size

property Tensor.size

For details, please refer to mindspore.ops.size().

Warning

Non-backward-compatible change after version 2.9.0: the current property-style access will be changed to the size(dim=None) method form.

Examples

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