序列映射

SequenceMap - 17

版本

  • 名称: SequenceMap (GitHub)

  • 域名: main

  • since_version: 17

  • function: True

  • support_level: SupportType.COMMON

  • 形状推断: True

此版本的运算符自版本17起可用。

摘要

将子图应用于输入序列中的每个样本。

输入可以是张量或序列,除了第一个输入必须是序列。第一个输入序列的长度将决定输出中的样本数量。任何其他序列输入应具有相同数量的样本。输入和输出的数量应与子图的数量匹配。

对于输出中的每个第i个元素,将从输入序列的第i个位置提取一个样本,并将子图应用于它。 输出将包含每个样本的子图输出,顺序与输入中的顺序相同。

该操作符假设处理每个样本是独立的,可以并行或以任何顺序执行。用户不能期望每个子图的计算有任何特定的顺序。

属性

  • body - GRAPH (必填) :

    要为序列中的每个样本运行的图。它应该具有与SequenceMap函数的输入和输出一样多的输入和输出。

输入

介于1到2147483647之间的输入。

  • input_sequence (异构) - S:

    输入序列。

  • additional_inputs (可变参数) - V:

    图形的额外输入

输出

输出在1到2147483647之间。

  • out_sequence (可变参数) - S:

    输出序列

类型约束

  • S 在 ( seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)) ):

    将输入类型限制为任何序列类型。

  • V 在 ( seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ):

    约束为任何张量或序列类型。