mindspore2022/docs/api/api_python/ops/mindspore.ops.TupleToArray.rst

21 lines
720 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.TupleToArray
===========================
.. py:class:: mindspore.ops.TupleToArray
将tuple转换为Tensor。
如果tuple中第一个数据类型为int则输出Tensor的数据类型为int。否则输出Tensor的数据类型为float。
**输入:**
- **input_x** (tuple) - 数值型组成的tuple。其元素具有相同的类型。仅支持常量值。shape为 :math:`(N,*)` ,其中 :math:`*` 表示任意数量的附加维度。
**输出:**
Tensor。如果输入tuple包含 `N` 个数值型元素则输出Tensor的shape为(N,)。
**异常:**
- **TypeError** - `input_x` 不是tuple。
- **ValueError** - `input_x` 的长度小于或等于0。