mindspore.Tensor.shape

property Tensor.shape

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

Examples

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