ONNX 运算符

列出所有 ONNX 运算符。对于每个运算符,列出使用指南、参数、示例和逐行版本历史记录。本节还包括详细说明每个运算符及其版本的表格,如 Operators.md 中所做的那样。

所有示例都以调用函数 expect 结束,该函数检查运行时是否为此示例生成预期的输出。一个基于 onnxruntime 的实现可以在 示例运算符测试代码 中找到。

运算符

版本

差异

Abs

13, 6, 1

13/6, 13/1, 6/1

Acos

22, 7

22/7

Acosh

22, 9

22/9

Add

14, 13, 7, 6, 1

14/13, 14/7, 13/7, 14/6, 13/6, 7/6, 14/1, 13/1, 7/1, 6/1

AffineGrid

20

And

7, 1

7/1

ArgMax

13, 12, 11, 1

13/12, 13/11, 12/11, 13/1, 12/1, 11/1

ArgMin

13, 12, 11, 1

13/12, 13/11, 12/11, 13/1, 12/1, 11/1

Asin

22, 7

22/7

Asinh

22, 9

22/9

Atan

22, 7

22/7

Atanh

22, 9

22/9

AveragePool

22, 19, 11, 10, 7, 1

22/19, 22/11, 19/11, 22/10, 19/10, 11/10, 22/7, 19/7, 11/7, 10/7, 22/1, 19/1, 11/1, 10/1, 7/1

BatchNormalization

15, 14, 9, 7, 6, 1

15/14, 15/9, 14/9, 15/7, 14/7, 9/7, 15/6, 14/6, 9/6, 7/6, 15/1, 14/1, 9/1, 7/1, 6/1

Bernoulli

22, 15

22/15

BitShift

11

BitwiseAnd

18

BitwiseNot

18

BitwiseOr

18

BitwiseXor

18

BlackmanWindow

17

Cast

23, 21, 19, 13, 9, 6, 1

23/21, 23/19, 21/19, 23/13, 21/13, 19/13, 23/9, 21/9, 19/9, 13/9, 23/6, 21/6, 19/6, 13/6, 9/6, 23/1, 21/1, 19/1, 13/1, 9/1, 6/1

CastLike

23, 21, 19, 15

23/21, 23/19, 21/19, 23/15, 21/15, 19/15

Ceil

13, 6, 1

13/6, 13/1, 6/1

Celu

12

CenterCropPad

18

Clip

13, 12, 11, 6, 1

13/12, 13/11, 12/11, 13/6, 12/6, 11/6, 13/1, 12/1, 11/1, 6/1

Col2Im

18

Compress

11, 9

11/9

Concat

13, 11, 4, 1

13/11, 13/4, 11/4, 13/1, 11/1, 4/1

ConcatFromSequence

11

Constant

23, 21, 19, 13, 12, 11, 9, 1

23/21, 23/19, 21/19, 23/13, 21/13, 19/13, 23/12, 21/12, 19/12, 13/12, 23/11, 21/11, 19/11, 13/11, 12/11, 23/9, 21/9, 19/9, 13/9, 12/9, 11/9, 23/1, 21/1, 19/1, 13/1, 12/1, 11/1, 9/1

ConstantOfShape

23, 21, 20, 9

23/21, 23/20, 21/20, 23/9, 21/9, 20/9

Conv

22, 11, 1

22/11, 22/1, 11/1

ConvInteger

10

ConvTranspose

22, 11, 1

22/11, 22/1, 11/1

Cos

22, 7

22/7

Cosh

22, 9

22/9

CumSum

14, 11

14/11

DFT

20, 17

20/17

DeformConv

22, 19

22/19

DepthToSpace

13, 11, 1

13/11, 13/1, 11/1

DequantizeLinear

23, 21, 19, 13, 10

23/21, 23/19, 21/19, 23/13, 21/13, 19/13, 23/10, 21/10, 19/10, 13/10

Det

22, 11

22/11

Div

14, 13, 7, 6, 1

14/13, 14/7, 13/7, 14/6, 13/6, 7/6, 14/1, 13/1, 7/1, 6/1

Dropout

22, 13, 12, 10, 7, 6, 1

22/13, 22/12, 13/12, 22/10, 13/10, 12/10, 22/7, 13/7, 12/7, 10/7, 22/6, 13/6, 12/6, 10/6, 7/6, 22/1, 13/1, 12/1, 10/1, 7/1, 6/1

DynamicQuantizeLinear

11

Einsum

12

Elu

22, 6, 1

22/6, 22/1, 6/1

Equal

19, 13, 11, 7, 1

19/13, 19/11, 13/11, 19/7, 13/7, 11/7, 19/1, 13/1, 11/1, 7/1

Erf

13, 9

13/9

Exp

13, 6, 1

13/6, 13/1, 6/1

Expand

13, 8

13/8

EyeLike

22, 9

22/9

Flatten

23, 21, 13, 11, 9, 1

23/21, 23/13, 21/13, 23/11, 21/11, 13/11, 23/9, 21/9, 13/9, 11/9, 23/1, 21/1, 13/1, 11/1, 9/1

Floor

13, 6, 1

13/6, 13/1, 6/1

GRU

22, 14, 7, 3, 1

22/14, 22/7, 14/7, 22/3, 14/3, 7/3, 22/1, 14/1, 7/1, 3/1

Gather

13, 11, 1

13/11, 13/1, 11/1

GatherElements

13, 11

13/11

GatherND

13, 12, 11

13/12, 13/11, 12/11

Gelu

20

Gemm

13, 11, 9, 7, 6, 1

13/11, 13/9, 11/9, 13/7, 11/7, 9/7, 13/6, 11/6, 9/6, 7/6, 13/1, 11/1, 9/1, 7/1, 6/1

全局平均池化 (GlobalAveragePool)

22, 1

22/1

全局Lp池化 (GlobalLpPool)

22, 2, 1

22/2, 22/1, 2/1

全局最大池化 (GlobalMaxPool)

22, 1

22/1

大于 (Greater)

13, 9, 7, 1

13/9, 13/7, 9/7, 13/1, 9/1, 7/1

大于等于 (GreaterOrEqual)

16, 12

16/12

网格采样 (GridSample)

22, 20, 16

22/20, 22/16, 20/16

组归一化 (GroupNormalization)

21, 18

21/18

汉明窗 (HammingWindow)

17

汉宁窗 (HannWindow)

17

硬Sigmoid (HardSigmoid)

22, 6, 1

22/6, 22/1, 6/1

硬Swish (HardSwish)

22, 14

22/14

硬最大值 (Hardmax)

13, 11, 1

13/11, 13/1, 11/1

恒等 (Identity)

23, 21, 19, 16, 14, 13, 1

23/21, 23/19, 21/19, 23/16, 21/16, 19/16, 23/14, 21/14, 19/14, 16/14, 23/13, 21/13, 19/13, 16/13, 14/13, 23/1, 21/1, 19/1, 16/1, 14/1, 13/1

如果 (If)

23, 21, 19, 16, 13, 11, 1

23/21, 23/19, 21/19, 23/16, 21/16, 19/16, 23/13, 21/13, 19/13, 16/13, 23/11, 21/11, 19/11, 16/11, 13/11, 23/1, 21/1, 19/1, 16/1, 13/1, 11/1

图像解码器 (ImageDecoder)

20

实例归一化 (InstanceNormalization)

22, 6, 1

22/6, 22/1, 6/1

是否为无穷大 (IsInf)

20, 10

20/10

是否为NaN (IsNaN)

20, 13, 9

20/13, 20/9, 13/9

局部响应归一化 (LRN)

13, 1

13/1

长短期记忆网络 (LSTM)

22, 14, 7, 1

22/14, 22/7, 14/7, 22/1, 14/1, 7/1

层归一化 (LayerNormalization)

17

泄露ReLU (LeakyRelu)

16, 6, 1

16/6, 16/1, 6/1

小于 (Less)

13, 9, 7, 1

13/9, 13/7, 9/7, 13/1, 9/1, 7/1

小于等于 (LessOrEqual)

16, 12

16/12

对数 (Log)

13, 6, 1

13/6, 13/1, 6/1

对数Softmax (LogSoftmax)

13, 11, 1

13/11, 13/1, 11/1

循环 (Loop)

23, 21, 19, 16, 13, 11, 1

23/21, 23/19, 21/19, 23/16, 21/16, 19/16, 23/13, 21/13, 19/13, 16/13, 23/11, 21/11, 19/11, 16/11, 13/11, 23/1, 21/1, 19/1, 16/1, 13/1, 11/1

Lp归一化 (LpNormalization)

22, 1

22/1

Lp池化 (LpPool)

22, 18, 11, 2, 1

22/18, 22/11, 18/11, 22/2, 18/2, 11/2, 22/1, 18/1, 11/1, 2/1

矩阵乘法 (MatMul)

13, 9, 1

13/9, 13/1, 9/1

整数矩阵乘法 (MatMulInteger)

10

最大值 (Max)

13, 12, 8, 6, 1

13/12, 13/8, 12/8, 13/6, 12/6, 8/6, 13/1, 12/1, 8/1, 6/1

最大池化 (MaxPool)

22, 12, 11, 10, 8, 1

22/12, 22/11, 12/11, 22/10, 12/10, 11/10, 22/8, 12/8, 11/8, 10/8, 22/1, 12/1, 11/1, 10/1, 8/1

最大RoI池化 (MaxRoiPool)

22, 1

22/1

最大反池化 (MaxUnpool)

22, 11, 9

22/11, 22/9, 11/9

平均值 (Mean)

13, 8, 6, 1

13/8, 13/6, 8/6, 13/1, 8/1, 6/1

均值方差归一化 (MeanVarianceNormalization)

13, 9

13/9

梅尔权重矩阵 (MelWeightMatrix)

17

最小值 (Min)

13, 12, 8, 6, 1

13/12, 13/8, 12/8, 13/6, 12/6, 8/6, 13/1, 12/1, 8/1, 6/1

Mish (Mish)

22, 18

22/18

取模 (Mod)

13, 10

13/10

乘法 (Mul)

14, 13, 7, 6, 1

14/13, 14/7, 13/7, 14/6, 13/6, 7/6, 14/1, 13/1, 7/1, 6/1

多项式 (Multinomial)

22, 7

22/7

负号 (Neg)

13, 6, 1

13/6, 13/1, 6/1

负对数似然损失 (NegativeLogLikelihoodLoss)

22, 13, 12

22/13, 22/12, 13/12

非最大值抑制 (NonMaxSuppression)

11, 10

11/10

非零 (NonZero)

13, 9

13/9

非 (Not)

1

独热编码 (OneHot)

11, 9

11/9

可选 (Optional)

15

获取可选元素 (OptionalGetElement)

18, 15

18/15

是否有可选元素 (OptionalHasElement)

18, 15

18/15

或 (Or)

7, 1

7/1

PReLU (PRelu)

16, 9, 7, 6, 1

16/9, 16/7, 9/7, 16/6, 9/6, 7/6, 16/1, 9/1, 7/1, 6/1

填充 (Pad)

23, 21, 19, 18, 13, 11, 2, 1

23/21, 23/19, 21/19, 23/18, 21/18, 19/18, 23/13, 21/13, 19/13, 18/13, 23/11, 21/11, 19/11, 18/11, 13/11, 23/2, 21/2, 19/2, 18/2, 13/2, 11/2, 23/1, 21/1, 19/1, 18/1, 13/1, 11/1, 2/1

幂 (Pow)

15, 13, 12, 7, 1

15/13, 15/12, 13/12, 15/7, 13/7, 12/7, 15/1, 13/1, 12/1, 7/1

量化线性卷积 (QLinearConv)

10

量化线性矩阵乘法 (QLinearMatMul)

21, 10

21/10

量化线性 (QuantizeLinear)

23, 21, 19, 13, 10

23/21, 23/19, 21/19, 23/13, 21/13, 19/13, 23/10, 21/10, 19/10, 13/10

循环神经网络 (RNN)

22, 14, 7, 1

22/14, 22/7, 14/7, 22/1, 14/1, 7/1

随机正态分布 (RandomNormal)

22, 1

22/1

类似随机正态分布 (RandomNormalLike)

22, 1

22/1

随机均匀分布 (RandomUniform)

22, 1

22/1

类似随机均匀分布 (RandomUniformLike)

22, 1

22/1

范围

11

倒数

13, 6, 1

13/6, 13/1, 6/1

ReduceL1

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceL2

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceLogSum

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceLogSumExp

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceMax

20, 18, 13, 12, 11, 1

20/18, 20/13, 18/13, 20/12, 18/12, 13/12, 20/11, 18/11, 13/11, 12/11, 20/1, 18/1, 13/1, 12/1, 11/1

ReduceMean

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceMin

20, 18, 13, 12, 11, 1

20/18, 20/13, 18/13, 20/12, 18/12, 13/12, 20/11, 18/11, 13/11, 12/11, 20/1, 18/1, 13/1, 12/1, 11/1

ReduceProd

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

ReduceSum

13, 11, 1

13/11, 13/1, 11/1

ReduceSumSquare

18, 13, 11, 1

18/13, 18/11, 13/11, 18/1, 13/1, 11/1

RegexFullMatch

20

Relu

14, 13, 6, 1

14/13, 14/6, 13/6, 14/1, 13/1, 6/1

Reshape

23, 21, 19, 14, 13, 5, 1

23/21, 23/19, 21/19, 23/14, 21/14, 19/14, 23/13, 21/13, 19/13, 14/13, 23/5, 21/5, 19/5, 14/5, 13/5, 23/1, 21/1, 19/1, 14/1, 13/1, 5/1

Resize

19, 18, 13, 11, 10

19/18, 19/13, 18/13, 19/11, 18/11, 13/11, 19/10, 18/10, 13/10, 11/10

ReverseSequence

10

RoiAlign

22, 16, 10

22/16, 22/10, 16/10

Round

22, 11

22/11

STFT

17

Scan

23, 21, 19, 16, 11, 9, 8

23/21, 23/19, 21/19, 23/16, 21/16, 19/16, 23/11, 21/11, 19/11, 16/11, 23/9, 21/9, 19/9, 16/9, 11/9, 23/8, 21/8, 19/8, 16/8, 11/8, 9/8

Scatter

11, 9

11/9

ScatterElements

18, 16, 13, 11

18/16, 18/13, 16/13, 18/11, 16/11, 13/11

ScatterND

18, 16, 13, 11

18/16, 18/13, 16/13, 18/11, 16/11, 13/11

Selu

22, 6, 1

22/6, 22/1, 6/1

SequenceAt

11

SequenceConstruct

11

SequenceEmpty

11

SequenceErase

11

SequenceInsert

11

SequenceLength

11

SequenceMap

17

Shape

23, 21, 19, 15, 13, 1

23/21, 23/19, 21/19, 23/15, 21/15, 19/15, 23/13, 21/13, 19/13, 15/13, 23/1, 21/1, 19/1, 15/1, 13/1

Shrink

9

Sigmoid

13, 6, 1

13/6, 13/1, 6/1

Sign

13, 9

13/9

Sin

22, 7

22/7

Sinh

22, 9

22/9

Size

23, 21, 19, 13, 1

23/21, 23/19, 21/19, 23/13, 21/13, 19/13, 23/1, 21/1, 19/1, 13/1

Slice

13, 11, 10, 1

13/11, 13/10, 11/10, 13/1, 11/1, 10/1

Softmax

13, 11, 1

13/11, 13/1, 11/1

SoftmaxCrossEntropyLoss

13, 12

13/12

Softplus

22, 1

22/1

Softsign

22, 1

22/1

SpaceToDepth

13, 1

13/1

Split

18, 13, 11, 2, 1

18/13, 18/11, 13/11, 18/2, 13/2, 11/2, 18/1, 13/1, 11/1, 2/1

SplitToSequence

11

Sqrt

13, 6, 1

13/6, 13/1, 6/1

Squeeze

23, 21, 13, 11, 1

23/21, 23/13, 21/13, 23/11, 21/11, 13/11, 23/1, 21/1, 13/1, 11/1

StringConcat

20

StringNormalizer

10

StringSplit

20

Sub

14, 13, 7, 6, 1

14/13, 14/7, 13/7, 14/6, 13/6, 7/6, 14/1, 13/1, 7/1, 6/1

Sum

13, 8, 6, 1

13/8, 13/6, 8/6, 13/1, 8/1, 6/1

Tan

22, 7

22/7

Tanh

13, 6, 1

13/6, 13/1, 6/1

TfIdfVectorizer

9

ThresholdedRelu

22, 10

22/10

Tile

13, 6, 1

13/6, 13/1, 6/1

TopK

11, 10, 1

11/10, 11/1, 10/1

Transpose

23, 21, 13, 1

23/21, 23/13, 21/13, 23/1, 21/1, 13/1

Trilu

14

Unique

11

Unsqueeze

23, 21, 13, 11, 1

23/21, 23/13, 21/13, 23/11, 21/11, 13/11, 23/1, 21/1, 13/1, 11/1

Upsample

10, 9, 7, 1

10/9, 10/7, 9/7, 10/1, 9/1, 7/1

哪里

16, 9

16/9

异或

7, 1

7/1