ONNX Operators¶

Lists out all the ONNX operators. For each operator, lists out the usage guide, parameters, examples, and line-by-line version history. This section also includes tables detailing each operator with its versions, as done in Operators.md.

All examples end by calling function expect. which checks a runtime produces the expected output for this example. One implementation based on onnxruntime can be found at Sample operator test code.

operator

versions

differences

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

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

HardSigmoid

22, 6, 1

22/6, 22/1, 6/1

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

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

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

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

LpNormalization

22, 1

22/1

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

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

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

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

Range

11

Reciprocal

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

Where

16, 9

16/9

Xor

7, 1

7/1