mindspore.ops.TensorShape

class mindspore.ops.TensorShape[源代码]

返回输入Tensor的Shape。

支持平台:

Ascend GPU CPU

样例:

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