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

30 lines
1.3 KiB
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.HyperMap
=======================
.. py:class:: mindspore.ops.HyperMap(ops=None, reverse=False)
`HyperMap` 可以对输入序列做集合运算。
对序列的每个元素或嵌套序列进行运算。与 `Map` 不同,`HyperMap` 能够用于嵌套结构。
**参数:**
- **ops** (Union[MultitypeFuncGraph, None]) `ops` 是指定运算操作。如果 `ops` 为None则运算应该作为 `HyperMap` 实例的第一个入参。默认值为None。
- **reverse** (bool) - 在某些场景下,需要逆向以提高计算的并行性能,一般情况下,用户可以忽略。`reverse` 用于决定是否逆向执行运算仅在图模式下支持。默认值为False。
**输入:**
- **args** (Tuple[sequence]) - 如果 `ops` 不是None则所有入参都应该是具有相同长度的序列并且序列的每一行都是运算的输入。如果 `ops` 是None则第一个入参是运算其余都是输入。
.. note::
对于算子的输入,输入数量应该等于输入 `ops` 的数量。
**输出:**
序列或嵌套序列,执行函数如 `operation(args[0][i], args[1][i])` 之后输出的序列。
**异常:**
- **TypeError** - 如果 `ops` 既不是 `MultitypeFuncGraph` 也不是None。
- **TypeError** - 如果 `args` 不是一个tuple。