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

22 lines
739 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.ExpandDims
========================
.. py:class:: mindspore.ops.ExpandDims
对输入 `input_x` 在给定的轴上添加额外维度。
.. note::
如果指定的轴是负数则索引从末尾向后计数从1开始。
**输入:**
- **input_x** (Tensor) - Tensor的shape是 :math:`(x_1, x_2, ..., x_R)`
- **axis** (int) - 指定需添加额外维度的轴。轴值必须在[-input_x.ndim-1, input_x.ndim]范围内。只支持常量值。
**输出:**
TensorTensor的shape为 :math:`(1, x_1, x_2, ..., x_R)` `axis` 的值为0。其数据类型与 `input_x` 的相同。
**异常:**
- **ValueError** - `axis` 的值不是int或不在有效范围内。