mindspore.ops.dyn_shape
- mindspore.ops.dyn_shape(input_x)[source]
Returns the shape of the input tensor.
- Parameters
input_x (Tensor) – The input tensor.
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input_x = mindspore.tensor(mindspore.ops.ones(shape=[3, 2, 1]), mindspore.float32) >>> output = mindspore.ops.dyn_shape(input_x) >>> print(output) [3 2 1]