mindspore/docs/api/api_python/ops/mindspore.ops.func_shape.rst

18 lines
639 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.shape
====================
.. py:function:: mindspore.ops.shape(input_x)
返回输入Tensor的shape。用于静态shape。
静态shape不运行图就可以获得的shape。它是Tensor的固有属性可能是未知的。静态shape信息可以通过人工设置完成。无论图的输入是什么静态shape都不会受到影响。
参数:
- **input_x** (Tensor) - Tensor的shape为 :math:`(x_1,x_2,...,x_R)`
返回:
tuple[int]输出tuple由多个整数组成 :math:`(x_1,x_2,...,x_R)`
异常:
- **TypeError** - 如果 `input_x` 不是Tensor。