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

21 lines
799 B
ReStructuredText
Raw Permalink 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.dstack
====================
.. py:function:: mindspore.ops.dstack(inputs)
将多个Tensor沿着深度方向进行堆叠。
相当于将输入沿着第三个轴进行拼接。
1-D Tensor :math:`(N,)` 重新排列为 :math:`(1,N,1)` 2-D Tensor :math:`(M,N)` 重新排列为 :math:`(M,N,1)`
参数:
- **inputs** (Union(List[Tensor], Tuple[Tensor])) - 一个Tensor序列。除了第三个轴外所有的
Tensor必须有相同的shape。如果是1-D或2-D的Tensor则它们的shape必须相同。
返回:
堆叠后的Tensor其维度至少为3。输出shape与 `numpy.dstack()` 类似。
异常:
- **TypeError** - 如果 `inputs` 不是list或tuple。
- **ValueError** - 如果 `inputs` 为空。