mindspore.ops.Shape

class mindspore.ops.Shape[source]

Returns the shape of the input tensor. And it used to be static shape.

Refer to mindspore.ops.shape() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> input_x = Tensor(np.ones(shape=[3, 2, 1]), mindspore.float32)
>>> shape = ops.Shape()
>>> output = shape(input_x)
>>> print(output)
(3, 2, 1)