mindspore.ops.shape
====================

.. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.3.1/resource/_static/logo_source.svg
    :target: https://gitee.com/mindspore/mindspore/blob/r2.3.1/docs/api/api_python/ops/mindspore.ops.func_shape.rst
    :alt: 查看源文件


.. py:function:: mindspore.ops.shape(input_x)

    返回输入Tensor的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。