You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.Stack.rst 1.0 kB

123456789101112131415161718192021222324252627
  1. mindspore.ops.Stack
  2. ====================
  3. .. py:class:: mindspore.ops.Stack(axis=0)
  4. 在指定轴上对输入Tensor序列进行堆叠。
  5. 输入秩为 `R` 的Tensor序列,则输出秩为 `(R+1)` 的Tensor。
  6. 给定输入Tensor的shape为 :math:`(x_1, x_2, ..., x_R)` 。若输入Tensor的长度为 `N` 。如果存在 :math:`axis \ge 0` ,则输出Tensor的shape为 :math:`(x_1, x_2, ..., x_{axis}, N, x_{axis+1}, ..., x_R)` 。
  7. **参数:**
  8. - **axis** (int) - 指定堆叠运算的轴。取值范围为[-(R+1), R+1)。默认值:0。
  9. **输入:**
  10. - **input_x** (Union[tuple, list]) - 输入多个Tensor对象组成的tuple或list,每个Tensor具有相同shape和数据类型。
  11. **输出:**
  12. 堆叠运算后的Tensor,数据类型和 `input_x` 的相同。
  13. **异常:**
  14. - **TypeError** - `input_x` 中元素的数据类型不相同。
  15. - **ValueError** - `input_x` 的长度不大于1,或axis不在[-(R+1),R+1)范围中,或 `input_x` 中元素的shape不相同。