SequenceMap¶
SequenceMap - 17¶
版本¶
域:
main
起始版本:
17
函数:
True
支持级别:
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)
) 中约束为任何张量或序列类型。