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.TupleToArray.rst 720 B

123456789101112131415161718192021
  1. mindspore.ops.TupleToArray
  2. ===========================
  3. .. py:class:: mindspore.ops.TupleToArray
  4. 将tuple转换为Tensor。
  5. 如果tuple中第一个数据类型为int,则输出Tensor的数据类型为int。否则,输出Tensor的数据类型为float。
  6. **输入:**
  7. - **input_x** (tuple) - 数值型组成的tuple。其元素具有相同的类型。仅支持常量值。shape为 :math:`(N,*)` ,其中 :math:`*` 表示任意数量的附加维度。
  8. **输出:**
  9. Tensor。如果输入tuple包含 `N` 个数值型元素,则输出Tensor的shape为(N,)。
  10. **异常:**
  11. - **TypeError** - `input_x` 不是tuple。
  12. - **ValueError** - `input_x` 的长度小于或等于0。