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

7

Acosh

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

7

Asinh

9

Atan

7

Atanh

9

AveragePool

19, 11, 10, 7, 1

19/11, 19/10, 11/10, 19/7, 11/7, 10/7, 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

15

BitShift

11

BitwiseAnd

18

BitwiseNot

18

BitwiseOr

18

BitwiseXor

18

BlackmanWindow

17

Cast

21, 19, 13, 9, 6, 1

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

CastLike

21, 19, 15

21/19, 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

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

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

ConstantOfShape

21, 20, 9

21/20, 21/9, 20/9

Conv

11, 1

11/1

ConvInteger

10

ConvTranspose

11, 1

11/1

Cos

7

Cosh

9

CumSum

14, 11

14/11

DFT

20, 17

20/17

DeformConv

19

DepthToSpace

13, 11, 1

13/11, 13/1, 11/1

DequantizeLinear

21, 19, 13, 10

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

Det

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

13, 12, 10, 7, 6, 1

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

DynamicQuantizeLinear

11

Einsum

12

Elu

6, 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

9

Flatten

21, 13, 11, 9, 1

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

Floor

13, 6, 1

13/6, 13/1, 6/1

GRU

14, 7, 3, 1

14/7, 14/3, 7/3, 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

1

GlobalLpPool

2, 1

2/1

GlobalMaxPool

1

Greater

13, 9, 7, 1

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

GreaterOrEqual

16, 12

16/12

GridSample

20, 16

20/16

GroupNormalization

21, 18

21/18

HammingWindow

17

HannWindow

17

HardSigmoid

6, 1

6/1

HardSwish

14

Hardmax

13, 11, 1

13/11, 13/1, 11/1

Identity

21, 19, 16, 14, 13, 1

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

If

21, 19, 16, 13, 11, 1

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

ImageDecoder

20

InstanceNormalization

6, 1

6/1

IsInf

20, 10

20/10

IsNaN

20, 13, 9

20/13, 20/9, 13/9

LRN

13, 1

13/1

LSTM

14, 7, 1

14/7, 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

21, 19, 16, 13, 11, 1

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

LpNormalization

1

LpPool

18, 11, 2, 1

18/11, 18/2, 11/2, 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

12, 11, 10, 8, 1

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

MaxRoiPool

1

MaxUnpool

11, 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

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

7

Neg

13, 6, 1

13/6, 13/1, 6/1

NegativeLogLikelihoodLoss

13, 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

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

21/19, 21/18, 19/18, 21/13, 19/13, 18/13, 21/11, 19/11, 18/11, 13/11, 21/2, 19/2, 18/2, 13/2, 11/2, 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

21, 19, 13, 10

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

RNN

14, 7, 1

14/7, 14/1, 7/1

RandomNormal

1

RandomNormalLike

1

RandomUniform

1

RandomUniformLike

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

21, 19, 14, 13, 5, 1

21/19, 21/14, 19/14, 21/13, 19/13, 14/13, 21/5, 19/5, 14/5, 13/5, 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

16, 10

16/10

Round

11

STFT

17

Scan

21, 19, 16, 11, 9, 8

21/19, 21/16, 19/16, 21/11, 19/11, 16/11, 21/9, 19/9, 16/9, 11/9, 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

6, 1

6/1

SequenceAt

11

SequenceConstruct

11

SequenceEmpty

11

SequenceErase

11

SequenceInsert

11

SequenceLength

11

SequenceMap

17

Shape

21, 19, 15, 13, 1

21/19, 21/15, 19/15, 21/13, 19/13, 15/13, 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

7

Sinh

9

Size

21, 19, 13, 1

21/19, 21/13, 19/13, 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

1

Softsign

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

21, 13, 11, 1

21/13, 21/11, 13/11, 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

7

Tanh

13, 6, 1

13/6, 13/1, 6/1

TfIdfVectorizer

9

ThresholdedRelu

10

Tile

13, 6, 1

13/6, 13/1, 6/1

TopK

11, 10, 1

11/10, 11/1, 10/1

Transpose

21, 13, 1

21/13, 21/1, 13/1

Trilu

14

Unique

11

Unsqueeze

21, 13, 11, 1

21/13, 21/11, 13/11, 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