Skip to content

Tracking issue for supported ONNX operators #14

Open
@robertknight

Description

@robertknight

This is a tracking issue listing which ONNX operators are currently supported.

Some things to note:

  • Support for an operator does not mean that all attributes or data types listed in the current spec are supported.
  • Some operators require additional dependencies to support. These typically require enabling additional crate features. For example the Random* ops require enabling the random crate feature
  • Some operators are deprecated in the spec. Their non-deprecated replacements are implemented. This includes: Scatter, Upsample.
  • Operators are usually implemented after finding a model that needs them. These models then serve as an initial test case. If you need an operator which is not currently listed as supported, it is helpful (but not essential) if you can point to an open source ONNX model which needs it.
Script used to generate list
from bs4 import BeautifulSoup
import requests

# URL of the ONNX operators page
url = "https://onnx.ai/onnx/operators/"

# Path to FlatBuffers schema listing supported ops.
schema_path = "src/schema.fbs"

# Fetch ONNX operators page and extract the list of operators.
#
# This assumes the operators are listed in the first table on the page and
# that the operator name is the first column.
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
operator_names = []

table = soup.find('table')
rows = table.find_all('tr')
for row in rows:
    cols = row.find_all('td')
    if len(cols) >= 1:
        operator_name = cols[0].text.strip()
        operator_names.append(operator_name)

# Scan FlatBuffers schema and extract supported operator names
supported_ops = set()
with open(schema_path) as fp:
    in_operator_type_enum = False
    for line in fp:
        if line.startswith('enum OperatorType'):
            in_operator_type_enum = True
            continue
        if line.startswith('}') and in_operator_type_enum:
            break

        if in_operator_type_enum:
            op_name = line.strip().replace(',', '')
            supported_ops.add(op_name)

# List operators and support status
for operator in operator_names:
    if operator in supported_ops:
        print(f"- [x] {operator}")
    else:
        print(f"- [ ] {operator}")

Operator list

  • Abs
  • Acos
  • Acosh
  • Add
  • AffineGrid
  • And
  • ArgMax
  • ArgMin
  • Asin
  • Asinh
  • Atan
  • Atanh
  • AveragePool
  • BatchNormalization
  • Bernoulli
  • BitShift
  • BitwiseAnd
  • BitwiseNot
  • BitwiseOr
  • BitwiseXor
  • BlackmanWindow
  • Cast
  • CastLike
  • Ceil
  • Celu
  • CenterCropPad
  • Clip
  • Col2Im
  • Compress
  • Concat
  • ConcatFromSequence
  • Constant (N/A - Constants are handled at model conversion time)
  • ConstantOfShape
  • Conv
  • ConvInteger
  • ConvTranspose
  • Cos
  • Cosh
  • CumSum
  • DFT
  • DeformConv
  • DepthToSpace (Support DepthToSpace operator #468)
  • DequantizeLinear
  • Det
  • Div
  • Dropout (Implement Dropout operator #652)
  • DynamicQuantizeLinear
  • Einsum
  • Elu
  • Equal
  • Erf
  • Exp
  • Expand
  • EyeLike
  • Flatten
  • Floor
  • GRU
  • Gather
  • GatherElements
  • GatherND
  • Gelu
  • Gemm
  • GlobalAveragePool
  • GlobalLpPool
  • GlobalMaxPool
  • Greater
  • GreaterOrEqual
  • GridSample
  • GroupNormalization
  • HammingWindow
  • HannWindow
  • HardSigmoid
  • HardSwish
  • Hardmax
  • Identity
  • If
  • ImageDecoder
  • InstanceNormalization
  • IsInf
  • IsNaN
  • LRN
  • LSTM
  • LayerNormalization
  • LeakyRelu
  • Less
  • LessOrEqual
  • Log
  • LogSoftmax
  • Loop
  • LpNormalization
  • LpPool
  • MatMul
  • MatMulInteger
  • Max
  • MaxPool
  • MaxRoiPool
  • MaxUnpool
  • Mean
  • MeanVarianceNormalization
  • MelWeightMatrix
  • Min
  • Mish
  • Mod
  • Mul
  • Multinomial
  • Neg
  • NegativeLogLikelihoodLoss
  • NonMaxSuppression
  • NonZero
  • Not
  • OneHot
  • Optional
  • OptionalGetElement
  • OptionalHasElement
  • Or
  • PRelu
  • Pad
  • Pow
  • QLinearConv
  • QLinearMatMul
  • QuantizeLinear
  • RNN
  • RandomNormal
  • RandomNormalLike
  • RandomUniform
  • RandomUniformLike
  • Range
  • Reciprocal
  • ReduceL1
  • ReduceL2
  • ReduceLogSum
  • ReduceLogSumExp
  • ReduceMax
  • ReduceMean
  • ReduceMin
  • ReduceProd
  • ReduceSum
  • ReduceSumSquare
  • RegexFullMatch
  • Relu
  • Reshape
  • Resize
  • ReverseSequence
  • RoiAlign
  • Round
  • STFT
  • Scan
  • Scatter (deprecated. The replacement ScatterElements is implemented)
  • ScatterElements
  • ScatterND
  • Selu
  • SequenceAt
  • SequenceConstruct
  • SequenceEmpty
  • SequenceErase
  • SequenceInsert
  • SequenceLength
  • SequenceMap
  • Shape
  • Shrink
  • Sigmoid
  • Sign
  • Sin
  • Sinh
  • Size
  • Slice
  • Softmax
  • SoftmaxCrossEntropyLoss
  • Softplus
  • Softsign
  • SpaceToDepth
  • Split
  • SplitToSequence
  • Sqrt
  • Squeeze
  • StringConcat
  • StringNormalizer
  • StringSplit
  • Sub
  • Sum
  • Tan
  • Tanh
  • TfIdfVectorizer
  • ThresholdedRelu
  • Tile
  • TopK
  • Transpose
  • Trilu
  • Unique
  • Unsqueeze
  • Upsample (deprecated. The replacement Resize is implemented)
  • Where
  • Xor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions