diff --git a/docs/operators.md b/docs/operators.md index a4faf3de..d694b606 100644 --- a/docs/operators.md +++ b/docs/operators.md @@ -6,142 +6,167 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat _This file is automatically generated from the def files via [this script](/tools/gen-doc.ts). Do not modify directly._ -| Operator | Cpu Backend | Wasm Backend | WebGl Backend | -| :---------------------------------------------------------------------------------------------------------------: | :-----------: | :-----------: | :-----------: | -| [Abs](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Abs) | 6+ | | 6+ | -| [Acos](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Acos) | 7+ | | 7+ | -| [Acosh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Acosh) | 9+ | | | -| [Add](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Add) | 7+ | 7+ | 7+ | -| [And](https://github.com/onnx/onnx/blob/master/docs/Operators.md#And) | 7+ | 7+ | 7+ | -| [ArgMax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ArgMax) | 1+ | | | -| [ArgMin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ArgMin) | | | | -| [Asin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Asin) | 7+ | | 7+ | -| [Asinh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Asinh) | 9+ | | | -| [Atan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Atan) | 7+ | | 7+ | -| [Atanh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Atanh) | 9+ | | | -| [AveragePool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#AveragePool) | 7-9, 10+ | 7-9, 10+ | 7-9, 10+ | -| [BatchNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BatchNormalization) | 7-8, 9+ | 7-8, 9+ | 7-8, 9+ | -| [Cast](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cast) | | | | -| [Ceil](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Ceil) | 6+ | | 6+ | -| [Clip](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Clip) | 6+ | 6+ | 6+ | -| [Compress](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Compress) | | | | -| [Concat](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Concat) | 4+ | | 4+ | -| [Constant](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Constant) | | | | -| [ConstantOfShape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConstantOfShape) | | | | -| [Conv](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Conv) | 1+ | 1+ | 1+ | -| [ConvInteger](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConvInteger) | | | | -| [ConvTranspose](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConvTranspose) | | | | -| [Cos](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cos) | 7+ | | 7+ | -| [Cosh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cosh) | 9+ | | | -| [DepthToSpace](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DepthToSpace) | | | | -| [DequantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DequantizeLinear) | | | | -| [Div](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Div) | 7+ | 7+ | 7+ | -| [Dropout](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Dropout) | 7-9, 10+ | | 7-9, 10+ | -| [Elu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Elu) | 6+ | | 6+ | -| [Equal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Equal) | | | 7+ | -| [Erf](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Erf) | | | | -| [Exp](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Exp) | 6+ | | 6+ | -| [Expand](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Expand) | | | | -| [EyeLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#EyeLike) | | | | -| [Flatten](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten) | 1-8, 9+ | | 1-8, 9+ | -| [Floor](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Floor) | 6+ | | 6+ | -| [GRU](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GRU) | | | | -| [Gather](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gather) | 1+ | | 1+ | -| [Gemm](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gemm) | 7-8, 9+ | 7-8, 9+ | 7-8, 9+ | -| [GlobalAveragePool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalAveragePool) | 1+ | 1+ | 1+ | -| [GlobalLpPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalLpPool) | | | | -| [GlobalMaxPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalMaxPool) | 1+ | 1+ | 1+ | -| [Greater](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Greater) | | | 7-8, 9+ | -| [HardSigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HardSigmoid) | | | | -| [Hardmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Hardmax) | | | | -| [Identity](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Identity) | | | 1+ | -| [If](https://github.com/onnx/onnx/blob/master/docs/Operators.md#If) | | | | -| [InstanceNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#InstanceNormalization) | 6+ | 6+ | 6+ | -| [IsInf](https://github.com/onnx/onnx/blob/master/docs/Operators.md#IsInf) | | | | -| [IsNaN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#IsNaN) | 9+ | | | -| [LRN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LRN) | 1+ | | | -| [LSTM](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LSTM) | | | | -| [LeakyRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) | 6+ | | 6+ | -| [Less](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Less) | | | 7-8, 9+ | -| [Log](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Log) | 6+ | | 6+ | -| [LogSoftmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LogSoftmax) | | | | -| [Loop](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Loop) | | | | -| [LpNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LpNormalization) | | | | -| [LpPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LpPool) | | | | -| [MatMul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MatMul) | 1-8, 9+ | 1-8, 9+ | 1-8, 9+ | -| [MatMulInteger](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MatMulInteger) | | | | -| [Max](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Max) | | | | -| [MaxPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxPool) | 1-7, 8-9, 10+ | 1-7, 8-9, 10+ | 1-7, 8-9, 10+ | -| [MaxRoiPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxRoiPool) | | | | -| [MaxUnpool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxUnpool) | | | | -| [Mean](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mean) | | | | -| [MeanVarianceNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MeanVarianceNormalization) | | | | -| [Min](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Min) | | | | -| [Mod](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mod) | | | | -| [Mul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mul) | 7+ | 7+ | 7+ | -| [Multinomial](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Multinomial) | | | | -| [Neg](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Neg) | 6+ | | 6+ | -| [NonMaxSuppression](https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonMaxSuppression) | | | | -| [NonZero](https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero) | | | | -| [Not](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Not) | 1+ | | 1+ | -| [OneHot](https://github.com/onnx/onnx/blob/master/docs/Operators.md#OneHot) | | | | -| [Or](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Or) | 7+ | 7+ | 7+ | -| [PRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#PRelu) | 7-8, 9+ | 7-8, 9+ | 7-8, 9+ | -| [Pad](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Pad) | 2+ | | 2+ | -| [Pow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Pow) | | | 7+ | -| [QLinearConv](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QLinearConv) | | | | -| [QLinearMatMul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QLinearMatMul) | | | | -| [QuantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QuantizeLinear) | | | | -| [RNN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RNN) | | | | -| [RandomNormal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomNormal) | | | | -| [RandomNormalLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomNormalLike) | | | | -| [RandomUniform](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomUniform) | | | | -| [RandomUniformLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomUniformLike) | | | | -| [Reciprocal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reciprocal) | 6+ | | | -| [ReduceL1](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceL1) | | | | -| [ReduceL2](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceL2) | | | | -| [ReduceLogSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceLogSum) | 1+ | | 1+ | -| [ReduceLogSumExp](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceLogSumExp) | | | | -| [ReduceMax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMax) | 1+ | | 1+ | -| [ReduceMean](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMean) | 1+ | | 1+ | -| [ReduceMin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMin) | 1+ | | 1+ | -| [ReduceProd](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceProd) | 1+ | | 1+ | -| [ReduceSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceSum) | 1+ | | 1+ | -| [ReduceSumSquare](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceSumSquare) | 1+ | | 1+ | -| [Relu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Relu) | 6+ | | 6+ | -| [Reshape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) | 5+ | | 5+ | -| [Resize](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Resize) | | | | -| [ReverseSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReverseSequence) | | | | -| [RoiAlign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RoiAlign) | | | | -| [Scan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scan) | | | | -| [Scatter](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scatter) | | | | -| [Selu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Selu) | | | | -| [Shape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shape) | | | | -| [Shrink](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shrink) | | | | -| [Sigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) | 6+ | | 6+ | -| [Sign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sign) | 9+ | | | -| [Sin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sin) | 7+ | | 7+ | -| [Sinh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sinh) | 9+ | | | -| [Size](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Size) | | | | -| [Slice](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Slice) | 1-9, 10+ | | 1-9, 10+ | -| [Softmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softmax) | 1+ | 1+ | 1+ | -| [Softplus](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softplus) | | | | -| [Softsign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softsign) | | | | -| [SpaceToDepth](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SpaceToDepth) | | | | -| [Split](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Split) | | | 2+ | -| [Sqrt](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sqrt) | 6+ | | 6+ | -| [Squeeze](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Squeeze) | 1+ | | 1+ | -| [StringNormalizer](https://github.com/onnx/onnx/blob/master/docs/Operators.md#StringNormalizer) | | | | -| [Sub](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sub) | 7+ | 7+ | 7+ | -| [Sum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sum) | 6-7, 8+ | 6-7, 8+ | 6-7, 8+ | -| [Tan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tan) | 7+ | | 7+ | -| [Tanh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) | 6+ | | 6+ | -| [TfIdfVectorizer](https://github.com/onnx/onnx/blob/master/docs/Operators.md#TfIdfVectorizer) | | | | -| [ThresholdedRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ThresholdedRelu) | | | | -| [Tile](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tile) | 6+ | | 6+ | -| [TopK](https://github.com/onnx/onnx/blob/master/docs/Operators.md#TopK) | | | | -| [Transpose](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Transpose) | 1+ | | 1+ | -| [Unsqueeze](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unsqueeze) | 1+ | | 1+ | -| [Upsample](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Upsample) | 7-8 | | 7-8 | -| [Where](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Where) | | | | -| [Xor](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Xor) | 7+ | 7+ | 7+ | +| Operator | Cpu Backend | Wasm Backend | WebGl Backend | +| :---------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| [Abs](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Abs) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Abs-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Abs-6) | +| [Acos](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Acos) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Acos-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Acos-7) | +| [Acosh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Acosh) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Acosh-9) | | | +| [Add](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Add) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Add-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Add-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Add-7) | +| [And](https://github.com/onnx/onnx/blob/master/docs/Operators.md#And) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#And-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#And-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#And-7) | +| [ArgMax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ArgMax) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ArgMax-1), [11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ArgMax-11) | | | +| [ArgMin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ArgMin) | | | | +| [Asin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Asin) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Asin-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Asin-7) | +| [Asinh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Asinh) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Asinh-9) | | | +| [Atan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Atan) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Atan-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Atan-7) | +| [Atanh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Atanh) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Atanh-9) | | | +| [AveragePool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#AveragePool) | [7-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-7), [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-10) | [7-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-7), [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-10) | [7-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-7), [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#AveragePool-10) | +| [BatchNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BatchNormalization) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-9) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-9) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-9) | +| [BitShift](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BitShift) | | | | +| [Cast](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cast) | | | | +| [Ceil](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Ceil) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Ceil-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Ceil-6) | +| [Celu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Celu) | | | | +| [Clip](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Clip) | [6-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Clip-6) | [6-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Clip-6) | [6-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Clip-6) | +| [Compress](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Compress) | | | | +| [Concat](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Concat) | [4-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-4), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-11) | | [4-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-4), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-11) | +| [ConcatFromSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConcatFromSequence) | | | | +| [Constant](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Constant) | | | | +| [ConstantOfShape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConstantOfShape) | | | | +| [Conv](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Conv) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-11) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-11) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Conv-11) | +| [ConvInteger](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConvInteger) | | | | +| [ConvTranspose](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ConvTranspose) | | | | +| [Cos](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cos) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cos-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cos-7) | +| [Cosh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cosh) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cosh-9) | | | +| [CumSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#CumSum) | | | | +| [DepthToSpace](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DepthToSpace) | | | | +| [DequantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DequantizeLinear) | | | | +| [Det](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Det) | | | | +| [Div](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Div) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Div-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Div-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Div-7) | +| [Dropout](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Dropout) | [7-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-7), [10-11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-10), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-12) | | [7-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-7), [10-11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-10), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Dropout-12) | +| [DynamicQuantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DynamicQuantizeLinear) | | | | +| [Einsum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Einsum) | | | | +| [Elu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Elu) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Elu-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Elu-6) | +| [Equal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Equal) | | | [7-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Equal-7), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Equal-11) | +| [Erf](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Erf) | | | | +| [Exp](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Exp) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Exp-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Exp-6) | +| [Expand](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Expand) | | | | +| [EyeLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#EyeLike) | | | | +| [Flatten](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten) | [1-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-1), [9-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-9), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-11) | | [1-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-1), [9-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-9), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Flatten-11) | +| [Floor](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Floor) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Floor-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Floor-6) | +| [GRU](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GRU) | | | | +| [Gather](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gather) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gather-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gather-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gather-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gather-11) | +| [GatherElements](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GatherElements) | | | | +| [GatherND](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GatherND) | | | | +| [Gemm](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Gemm) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-7), [9-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-9), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-11) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-7), [9-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-9), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-11) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-7), [9-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-9), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Gemm-11) | +| [GlobalAveragePool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalAveragePool) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalAveragePool-1) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalAveragePool-1) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalAveragePool-1) | +| [GlobalLpPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalLpPool) | | | | +| [GlobalMaxPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GlobalMaxPool) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalMaxPool-1) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalMaxPool-1) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#GlobalMaxPool-1) | +| [Greater](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Greater) | | | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Greater-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Greater-9) | +| [GreaterOrEqual](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GreaterOrEqual) | | | | +| [HardSigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HardSigmoid) | | | | +| [Hardmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Hardmax) | | | | +| [Identity](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Identity) | | | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Identity-1) | +| [If](https://github.com/onnx/onnx/blob/master/docs/Operators.md#If) | | | | +| [InstanceNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#InstanceNormalization) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#InstanceNormalization-6) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#InstanceNormalization-6) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#InstanceNormalization-6) | +| [IsInf](https://github.com/onnx/onnx/blob/master/docs/Operators.md#IsInf) | | | | +| [IsNaN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#IsNaN) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#IsNaN-9) | | | +| [LRN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LRN) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#LRN-1) | | | +| [LSTM](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LSTM) | | | | +| [LeakyRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#LeakyRelu-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#LeakyRelu-6) | +| [Less](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Less) | | | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Less-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Less-9) | +| [LessOrEqual](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LessOrEqual) | | | | +| [Log](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Log) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Log-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Log-6) | +| [LogSoftmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LogSoftmax) | | | | +| [Loop](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Loop) | | | | +| [LpNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LpNormalization) | | | | +| [LpPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LpPool) | | | | +| [MatMul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MatMul) | [1-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-1), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-9) | [1-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-1), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-9) | [1-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-1), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MatMul-9) | +| [MatMulInteger](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MatMulInteger) | | | | +| [Max](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Max) | | | | +| [MaxPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxPool) | [1-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-1), [8-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-8) | [1-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-1), [8-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-8) | [1-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-1), [8-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#MaxPool-8) | +| [MaxRoiPool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxRoiPool) | | | | +| [MaxUnpool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxUnpool) | | | | +| [Mean](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mean) | | | | +| [MeanVarianceNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MeanVarianceNormalization) | | | | +| [Min](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Min) | | | | +| [Mod](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mod) | | | | +| [Mul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mul) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-7) | +| [Multinomial](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Multinomial) | | | | +| [Neg](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Neg) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Neg-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Neg-6) | +| [NegativeLogLikelihoodLoss](https://github.com/onnx/onnx/blob/master/docs/Operators.md#NegativeLogLikelihoodLoss) | | | | +| [NonMaxSuppression](https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonMaxSuppression) | | | | +| [NonZero](https://github.com/onnx/onnx/blob/master/docs/Operators.md#NonZero) | | | | +| [Not](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Not) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Not-1) | | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Not-1) | +| [OneHot](https://github.com/onnx/onnx/blob/master/docs/Operators.md#OneHot) | | | | +| [Or](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Or) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Or-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Or-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Or-7) | +| [PRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#PRelu) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-9) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-9) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-7), [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#PRelu-9) | +| [Pad](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Pad) | [2-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Pad-2) | | [2-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Pad-2) | +| [Pow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Pow) | | | [7-11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Pow-7), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Pow-12) | +| [QLinearConv](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QLinearConv) | | | | +| [QLinearMatMul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QLinearMatMul) | | | | +| [QuantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#QuantizeLinear) | | | | +| [RNN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RNN) | | | | +| [RandomNormal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomNormal) | | | | +| [RandomNormalLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomNormalLike) | | | | +| [RandomUniform](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomUniform) | | | | +| [RandomUniformLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RandomUniformLike) | | | | +| [Range](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Range) | | | | +| [Reciprocal](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reciprocal) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reciprocal-6) | | | +| [ReduceL1](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceL1) | | | | +| [ReduceL2](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceL2) | | | | +| [ReduceLogSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceLogSum) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceLogSum-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceLogSum-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceLogSum-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceLogSum-11) | +| [ReduceLogSumExp](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceLogSumExp) | | | | +| [ReduceMax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMax) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-1), [11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-11), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-12) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-1), [11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-11), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMax-12) | +| [ReduceMean](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMean) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMean-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMean-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMean-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMean-11) | +| [ReduceMin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceMin) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-1), [11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-11), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-12) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-1), [11](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-11), [12+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceMin-12) | +| [ReduceProd](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceProd) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceProd-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceProd-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceProd-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceProd-11) | +| [ReduceSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceSum) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSum-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSum-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSum-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSum-11) | +| [ReduceSumSquare](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReduceSumSquare) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#ReduceSumSquare-11) | +| [Relu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Relu) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Relu-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Relu-6) | +| [Reshape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Reshape) | [5+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reshape-5) | | [5+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reshape-5) | +| [Resize](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Resize) | | | | +| [ReverseSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReverseSequence) | | | | +| [RoiAlign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RoiAlign) | | | | +| [Round](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Round) | | | | +| [Scan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scan) | | | | +| [Scatter](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scatter) | | | | +| [ScatterElements](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ScatterElements) | | | | +| [ScatterND](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ScatterND) | | | | +| [Selu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Selu) | | | | +| [SequenceAt](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceAt) | | | | +| [SequenceConstruct](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceConstruct) | | | | +| [SequenceEmpty](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceEmpty) | | | | +| [SequenceErase](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceErase) | | | | +| [SequenceInsert](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceInsert) | | | | +| [SequenceLength](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceLength) | | | | +| [Shape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shape) | | | | +| [Shrink](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shrink) | | | | +| [Sigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sigmoid-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sigmoid-6) | +| [Sign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sign) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sign-9) | | | +| [Sin](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sin) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sin-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sin-7) | +| [Sinh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sinh) | [9+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sinh-9) | | | +| [Size](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Size) | | | | +| [Slice](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Slice) | [1-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-1), [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-10), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-11) | | [1-9](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-1), [10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-10), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-11) | +| [Softmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softmax) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-11) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-11) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Softmax-11) | +| [SoftmaxCrossEntropyLoss](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SoftmaxCrossEntropyLoss) | | | | +| [Softplus](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softplus) | | | | +| [Softsign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Softsign) | | | | +| [SpaceToDepth](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SpaceToDepth) | | | | +| [Split](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Split) | | | [2-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Split-2), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Split-11) | +| [SplitToSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SplitToSequence) | | | | +| [Sqrt](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sqrt) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sqrt-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sqrt-6) | +| [Squeeze](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Squeeze) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Squeeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Squeeze-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Squeeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Squeeze-11) | +| [StringNormalizer](https://github.com/onnx/onnx/blob/master/docs/Operators.md#StringNormalizer) | | | | +| [Sub](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sub) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sub-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sub-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sub-7) | +| [Sum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sum) | [6-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-6), [8+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-8) | [6-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-6), [8+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-8) | [6-7](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-6), [8+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sum-8) | +| [Tan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tan) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tan-7) | | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tan-7) | +| [Tanh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tanh) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tanh-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tanh-6) | +| [TfIdfVectorizer](https://github.com/onnx/onnx/blob/master/docs/Operators.md#TfIdfVectorizer) | | | | +| [ThresholdedRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ThresholdedRelu) | | | | +| [Tile](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Tile) | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tile-6) | | [6+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Tile-6) | +| [TopK](https://github.com/onnx/onnx/blob/master/docs/Operators.md#TopK) | | | | +| [Transpose](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Transpose) | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Transpose-1) | | [1+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Transpose-1) | +| [Unique](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unique) | | | | +| [Unsqueeze](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Unsqueeze) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-11) | | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-1), [11+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Unsqueeze-11) | +| [Upsample](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Upsample) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7) | | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Upsample-7) | +| [Where](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Where) | | | | +| [Xor](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Xor) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Xor-7) | diff --git a/lib/backends/cpu/op-resolve-rules.ts b/lib/backends/cpu/op-resolve-rules.ts index 32d062de..1db7c98c 100644 --- a/lib/backends/cpu/op-resolve-rules.ts +++ b/lib/backends/cpu/op-resolve-rules.ts @@ -38,15 +38,15 @@ export const CPU_OP_RESOLVE_RULES: ReadonlyArray = [ ['Acosh', '', '9+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.acosh)], ['Add', '', '7+', () => new CpuBinaryOp(NUMBER_TYPES, (e1, e2) => (e1 + e2))], ['And', '', '7+', () => new CpuBinaryOp(['bool'], (e1, e2) => (e1 && e2))], - ['ArgMax', '', '1+', () => new CpuArgMax()], + ['ArgMax', '', '1-11', () => new CpuArgMax()], ['Asin', '', '7+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.asin)], ['Asinh', '', '9+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.asinh)], ['Atan', '', '7+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.atan)], ['Atanh', '', '9+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.atanh)], - ['AveragePool', '', '7+', () => new CpuAveragePool()], // TODO: support new attributes for AveragePool-10 + ['AveragePool', '', '7-10', () => new CpuAveragePool()], // TODO: support new attributes for AveragePool-10 ['BatchNormalization', '', '7+', () => new CpuBatchNormalization()], ['Ceil', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.ceil)], - ['Clip', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.clip, unaryOps.clipInitializer)], + ['Clip', '', '6-10', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.clip, unaryOps.clipInitializer)], ['Concat', '', '4+', () => new CpuConcat()], ['Conv', '', '1+', () => new CpuConv()], ['Cos', '', '7+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.cos)], @@ -58,7 +58,8 @@ export const CPU_OP_RESOLVE_RULES: ReadonlyArray = [ ['Flatten', '', '1+', () => new CpuFlatten()], ['Floor', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.floor)], ['Gather', '', '1+', () => new CpuGather()], - ['Gemm', '', '7+', () => new CpuGemm()], + ['Gemm', '', '7-10', () => new CpuGemm(false)], + ['Gemm', '', '11+', () => new CpuGemm(true)], ['GlobalAveragePool', '', '1+', () => new CpuGlobalAveragePool()], ['GlobalMaxPool', '', '1+', () => new CpuGlobalMaxPool()], ['ImageScaler', '', '1+', () => new CpuImageScaler()], @@ -68,7 +69,7 @@ export const CPU_OP_RESOLVE_RULES: ReadonlyArray = [ ['Log', '', '6+', () => new CpuUnaryOp(FLOAT_TYPES, unaryOps.log)], ['LRN', '', '1+', () => new CpuLrn()], ['MatMul', '', '1+', () => new CpuMatMul()], - ['MaxPool', '', '1+', () => new CpuMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 + ['MaxPool', '', '1-9', () => new CpuMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 ['Mul', '', '7+', () => new CpuBinaryOp(NUMBER_TYPES, (e1, e2) => (e1 * e2))], ['Neg', '', '6+', () => new CpuUnaryOp(NUMBER_TYPES, unaryOps.neg)], ['Not', '', '1+', () => new CpuUnaryOp(['bool'], unaryOps.not, undefined, 'bool')], diff --git a/lib/backends/cpu/ops/argMax.ts b/lib/backends/cpu/ops/argMax.ts index 21f0d62a..c3a2fdcc 100644 --- a/lib/backends/cpu/ops/argMax.ts +++ b/lib/backends/cpu/ops/argMax.ts @@ -12,7 +12,7 @@ export class CpuArgMax extends ArgMax { export function argMax(x: Tensor, axis: number, keepdims: boolean): Tensor { const rank = x.dims ? x.dims.length : 1; - axis = ShapeUtil.parseAxis(axis, rank); + axis = ShapeUtil.normalizeAxis(axis, rank); const outputDims = ReduceUtil.calcReduceShape(x.dims, [axis], true); const X = x.data; const Y = new Int32Array(ShapeUtil.size(outputDims)); diff --git a/lib/backends/cpu/ops/gather.ts b/lib/backends/cpu/ops/gather.ts index 45d7bc16..aa320577 100644 --- a/lib/backends/cpu/ops/gather.ts +++ b/lib/backends/cpu/ops/gather.ts @@ -11,7 +11,7 @@ export class CpuGather extends Gather { } export function gather(x: Tensor, indices: Tensor, axis: number): Tensor { - axis = ShapeUtil.parseAxis(axis, x.dims.length); + axis = ShapeUtil.normalizeAxis(axis, x.dims.length); const dims = x.dims.slice(); const newDims = dims.slice(); const indicesData = indices.data; @@ -24,7 +24,8 @@ export function gather(x: Tensor, indices: Tensor, axis: number): Tensor { for (let i = 0; i < Y.length; ++i) { const newLogicalIndex = ShapeUtil.offsetToIndices(i, newDimsStrides); const oldLogicalIndex = newLogicalIndex.slice(); - oldLogicalIndex[axis] = indicesData[newLogicalIndex[axis]] as number; + const idx = indicesData[newLogicalIndex[axis]] as number; + oldLogicalIndex[axis] = idx < 0 ? idx + dims[axis] : idx; const oldOffset = ShapeUtil.indicesToOffset(oldLogicalIndex, dimsStrides); Y[i] = X[oldOffset] as number; } diff --git a/lib/backends/cpu/ops/gemm.ts b/lib/backends/cpu/ops/gemm.ts index 0551415a..a82483cc 100644 --- a/lib/backends/cpu/ops/gemm.ts +++ b/lib/backends/cpu/ops/gemm.ts @@ -10,18 +10,20 @@ import {matMul2d} from './matmul'; export class CpuGemm extends Gemm { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = gemm(inputs[0], inputs[1], inputs[2], this.alpha, this.beta, this.transA, this.transB); + const output = gemm( + inputs[0], inputs[1], this.alpha, this.beta, this.transA, this.transB, + inputs.length === 3 ? inputs[2] : undefined); return [output]; } } -export function gemm(a: Tensor, b: Tensor, c: Tensor, alpha: number, beta: number, transA: boolean, transB: boolean) { - const [M, N, K] = util.GemmUtil.getShapeOfGemmResult(a.dims, transA, b.dims, transB, c.dims); +export function gemm(a: Tensor, b: Tensor, alpha: number, beta: number, transA: boolean, transB: boolean, c?: Tensor) { + const [M, N, K] = util.GemmUtil.getShapeOfGemmResult(a.dims, transA, b.dims, transB, c?.dims); // The result will always be of the shape [M,N] const output = new Tensor([M, N], a.type); // broadcast and assign value from C to output - if (util.BroadcastUtil.calc(output, c, (a, b) => b, true) !== output) { + if (c && util.BroadcastUtil.calc(output, c, (a, b) => b, true) !== output) { throw new Error(`tensor C is not broadcastable to [M,N]`); } diff --git a/lib/backends/cpu/ops/reduce.ts b/lib/backends/cpu/ops/reduce.ts index 54c41a06..98e92911 100644 --- a/lib/backends/cpu/ops/reduce.ts +++ b/lib/backends/cpu/ops/reduce.ts @@ -8,49 +8,49 @@ import {CpuInferenceHandler} from '../inference-handler'; export class CpuReduceSum extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[]|Promise { - const output = reduceSum(inputs[0], this.axes, this.keepDims); + const output = reduceSum(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceSumSquare extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceSumSquare(inputs[0], this.axes, this.keepDims); + const output = reduceSumSquare(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceLogSum extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceLogSum(inputs[0], this.axes, this.keepDims); + const output = reduceLogSum(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceMax extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceMax(inputs[0], this.axes, this.keepDims); + const output = reduceMax(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceMin extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceMin(inputs[0], this.axes, this.keepDims); + const output = reduceMin(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceMean extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceMean(inputs[0], this.axes, this.keepDims); + const output = reduceMean(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } export class CpuReduceProd extends ReduceBase { run(inferenceHandler: CpuInferenceHandler, inputs: Tensor[]): Tensor[] { - const output = reduceProd(inputs[0], this.axes, this.keepDims); + const output = reduceProd(inputs[0], ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length), this.keepDims); return [output]; } } diff --git a/lib/backends/cpu/ops/slice.ts b/lib/backends/cpu/ops/slice.ts index 189b573e..f107e2e8 100644 --- a/lib/backends/cpu/ops/slice.ts +++ b/lib/backends/cpu/ops/slice.ts @@ -31,18 +31,18 @@ export function slice( if (axes.length === 0) { axes = x.dims.map((val, ind) => ind); } - axes = axes.map(axis => ShapeUtil.parseAxis(axis, x.dims.length)); + axes = ShapeUtil.normalizeAxes(axes, x.dims.length); starts = starts.map((start, ind) => { if (start > x.dims[axes[ind]] - 1) { return x.dims[axes[ind]]; } - return ShapeUtil.parseAxis(start, x.dims[axes[ind]]); + return ShapeUtil.normalizeAxis(start, x.dims[axes[ind]]); }); ends = ends.map((end, ind) => { if (end > x.dims[axes[ind]] - 1) { return x.dims[axes[ind]]; } - return ShapeUtil.parseAxis(end, x.dims[axes[ind]]); + return ShapeUtil.normalizeAxis(end, x.dims[axes[ind]]); }); const size: number[] = []; const adjustedStarts: number[] = []; diff --git a/lib/backends/cpu/ops/softmax.ts b/lib/backends/cpu/ops/softmax.ts index af4494a2..9c8d0385 100644 --- a/lib/backends/cpu/ops/softmax.ts +++ b/lib/backends/cpu/ops/softmax.ts @@ -17,9 +17,9 @@ export function softmax(x: Tensor, axis: number): Tensor { const inputDimensions = x.dims; const inputRank = inputDimensions.length; - const axisCorrected = util.ShapeUtil.parseAxis(axis, inputRank); - const N = util.ShapeUtil.sizeToDimension(inputDimensions, axisCorrected); - const D = util.ShapeUtil.sizeFromDimension(inputDimensions, axisCorrected); + axis = util.ShapeUtil.normalizeAxis(axis, inputRank); + const N = util.ShapeUtil.sizeToDimension(inputDimensions, axis); + const D = util.ShapeUtil.sizeFromDimension(inputDimensions, axis); const X = x.numberData; diff --git a/lib/backends/wasm/op-resolve-rules.ts b/lib/backends/wasm/op-resolve-rules.ts index 826426d5..92fb6141 100644 --- a/lib/backends/wasm/op-resolve-rules.ts +++ b/lib/backends/wasm/op-resolve-rules.ts @@ -17,17 +17,18 @@ import {WasmSum} from './ops/sum'; export const WASM_OP_RESOLVE_RULES: ReadonlyArray = [ ['Add', '', '7+', () => new WasmBinaryOp(['float32'], 'Add')], ['And', '', '7+', () => new WasmBinaryOp(['bool'], 'And')], - ['AveragePool', '', '7+', () => new WasmAveragePool()], // TODO: support new attributes for AveragePool-10 + ['AveragePool', '', '7-10', () => new WasmAveragePool()], // TODO: support new attributes for AveragePool-10 ['BatchNormalization', '', '7+', () => new WasmBatchNormalization()], - ['Clip', '', '6+', () => new WasmClip()], + ['Clip', '', '6-10', () => new WasmClip()], ['Conv', '', '1+', () => new WasmConv()], ['Div', '', '7+', () => new WasmBinaryOp(['float32'], 'Div')], - ['Gemm', '', '7+', () => new WasmGemm()], + ['Gemm', '', '7-10', () => new WasmGemm(false)], + ['Gemm', '', '11+', () => new WasmGemm(true)], ['GlobalAveragePool', '', '1+', () => new WasmGlobalAveragePool()], ['GlobalMaxPool', '', '1+', () => new WasmGlobalMaxPool()], ['InstanceNormalization', '', '6+', () => new WasmInstanceNormalization()], ['MatMul', '', '1+', () => new WasmMatMul()], - ['MaxPool', '', '1+', () => new WasmMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 + ['MaxPool', '', '1-9', () => new WasmMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 ['Mul', '', '7+', () => new WasmBinaryOp(['float32'], 'Mul')], ['Or', '', '7+', () => new WasmBinaryOp(['bool'], 'Or')], ['PRelu', '', '7+', () => new WasmBinaryOp(['float32'], 'PRelu')], diff --git a/lib/backends/wasm/ops/gemm.ts b/lib/backends/wasm/ops/gemm.ts index afa0716a..18d66a2d 100644 --- a/lib/backends/wasm/ops/gemm.ts +++ b/lib/backends/wasm/ops/gemm.ts @@ -13,9 +13,9 @@ export class WasmGemm extends Gemm { const b = inputs[1]; const c = inputs[2]; - const [M, N] = GemmUtil.getShapeOfGemmResult(a.dims, this.transA, b.dims, this.transB, c.dims); + const [M, N] = GemmUtil.getShapeOfGemmResult(a.dims, this.transA, b.dims, this.transB, c?.dims); const y = new Tensor([M, N], a.type); - if (!BroadcastUtil.calc(y, c, (a, b) => (b), true)) { + if (c && !BroadcastUtil.calc(y, c, (a, b) => (b), true)) { throw new Error(`c is not broadcastable to the shape of the result of the Gemm operator`); } WasmBinding.getInstance().ccall( diff --git a/lib/backends/wasm/ops/softmax.ts b/lib/backends/wasm/ops/softmax.ts index a50595a2..5b2316e8 100644 --- a/lib/backends/wasm/ops/softmax.ts +++ b/lib/backends/wasm/ops/softmax.ts @@ -10,9 +10,9 @@ import {WasmInferenceHandler} from '../inference-handler'; export class WasmSoftmax extends Softmax { run(inferenceHandler: WasmInferenceHandler, inputs: Tensor[]): Tensor[] { const x = inputs[0]; - const axisCorrected = ShapeUtil.parseAxis(this.axis, x.dims.length); - const N = ShapeUtil.sizeToDimension(x.dims, axisCorrected); - const D = ShapeUtil.sizeFromDimension(x.dims, axisCorrected); + const axis = ShapeUtil.normalizeAxis(this.axis, x.dims.length); + const N = ShapeUtil.sizeToDimension(x.dims, axis); + const D = ShapeUtil.sizeFromDimension(x.dims, axis); const y = new Tensor(x.dims, x.type); WasmBinding.getInstance().ccall( '_softmax_f32', [x.floatData, 'float32ptr'], [y.floatData, 'float32ptr', 'out'], [N, 'int32'], [D, 'int32']); diff --git a/lib/backends/webgl/op-resolve-rules.ts b/lib/backends/webgl/op-resolve-rules.ts index a1e8bd19..7b9d56fe 100644 --- a/lib/backends/webgl/op-resolve-rules.ts +++ b/lib/backends/webgl/op-resolve-rules.ts @@ -40,10 +40,10 @@ export const WEBGL_OP_RESOLVE_RULES: ReadonlyArray = [ ['And', '', '7+', () => new binaryOps.WebGLBinaryOp(['bool'], binaryOps.glslAnd())], ['Asin', '', '7+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslAsin())], ['Atan', '', '7+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslAtan())], - ['AveragePool', '', '7+', () => new WebGLAveragePool()], // TODO: support new attributes for AveragePool-10 + ['AveragePool', '', '7-10', () => new WebGLAveragePool()], // TODO: support new attributes for AveragePool-10 ['BatchNormalization', '', '7+', () => new WebGLBatchNormalization()], ['Ceil', '', '6+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslCeil())], - ['Clip', '', '6+', () => new WebGLClip()], + ['Clip', '', '6-10', () => new WebGLClip()], ['Concat', '', '4+', () => new WebGLConcat()], ['Conv', '', '1+', () => new WebGLConv()], ['Cos', '', '7+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslCos())], @@ -55,7 +55,8 @@ export const WEBGL_OP_RESOLVE_RULES: ReadonlyArray = [ ['Flatten', '', '1+', () => new WebGLFlatten()], ['Floor', '', '6+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslFloor())], ['Gather', '', '1+', () => new WebGLGather()], - ['Gemm', '', '7+', () => new WebGLGemm()], + ['Gemm', '', '7-10', () => new WebGLGemm(false)], + ['Gemm', '', '11+', () => new WebGLGemm(true)], ['GlobalAveragePool', '', '1+', () => new WebGLGlobalAveragePool()], ['GlobalMaxPool', '', '1+', () => new WebGLGlobalMaxPool()], ['Greater', '', '7+', () => new binaryOps.WebGLBinaryOp(NUMBER_TYPES, binaryOps.glslGreater(), undefined, 'bool')], @@ -66,7 +67,7 @@ export const WEBGL_OP_RESOLVE_RULES: ReadonlyArray = [ ['Less', '', '7+', () => new binaryOps.WebGLBinaryOp(NUMBER_TYPES, binaryOps.glslLess(), undefined, 'bool')], ['Log', '', '6+', () => new unaryOps.WebGLUnaryOp(FLOAT_TYPES, unaryOps.glslLog())], ['MatMul', '', '1+', () => new WebGLMatMul()], - ['MaxPool', '', '1+', () => new WebGLMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 + ['MaxPool', '', '1-9', () => new WebGLMaxPool()], // TODO: support new attributes for MaxPool-8 and MaxPool-10 ['Mul', '', '7+', () => new binaryOps.WebGLBinaryOp(NUMBER_TYPES, binaryOps.glslMul())], ['Neg', '', '6+', () => new unaryOps.WebGLUnaryOp(NUMBER_TYPES, unaryOps.glslNeg())], ['Not', '', '1+', () => new unaryOps.WebGLUnaryOp(['bool'], unaryOps.glslNot())], diff --git a/lib/backends/webgl/ops/gather.ts b/lib/backends/webgl/ops/gather.ts index 7b249124..dc67e74f 100644 --- a/lib/backends/webgl/ops/gather.ts +++ b/lib/backends/webgl/ops/gather.ts @@ -2,6 +2,7 @@ import {Gather} from '../../../ops/gather'; import {Tensor} from '../../../tensor'; +import {ShapeUtil} from '../../../util'; import {WebGLInferenceHandler} from '../inference-handler'; import {ProgramInfo, RunData, WebGLOperator} from '../types'; @@ -19,22 +20,23 @@ export class WebGLGather extends Gather implements WebGLOperator { throw Error('A scalar tensor output has not been supported'); } + const axis = ShapeUtil.normalizeAxis(this.axis, inputShape.length); const indexCopyOps: string[] = []; for (let i = 0; i < outputShape.length; i++) { // outputShape is divided into three parts: A, B, C - // |0 this.axis| this.axis + indexDataShape.length| end| - // | A | B | C | + // |0 axis| axis + indexDataShape.length | end| + // | A | B | C | // // inputIdx: [A, inputs[1][B], C] - if (i < this.axis) { // A + if (i < axis) { // A outputShape[i] = inputShape[i]; indexCopyOps.push(`inputIdx[${i}] = outputIdx[${i}];`); } else { - if (i < this.axis + indexDataShape.length) { // B - outputShape[i] = indexDataShape[i - this.axis]; - indexCopyOps.push(`indexDataIdx[${i - this.axis}] = outputIdx[${i}];`); + if (i < axis + indexDataShape.length) { // B + outputShape[i] = indexDataShape[i - axis]; + indexCopyOps.push(`indexDataIdx[${i - axis}] = outputIdx[${i}];`); } else { // C - outputShape[i] = inputShape[i - indexDataShape.length + 1]; // skip 1 for this.axis + outputShape[i] = inputShape[i - indexDataShape.length + 1]; // skip 1 for axis indexCopyOps.push(`inputIdx[${i - indexDataShape.length + 1}] = outputIdx[${i}];`); } } @@ -48,7 +50,8 @@ export class WebGLGather extends Gather implements WebGLOperator { int inputIdx[${irank}]; int indexDataIdx[${iDrank}]; ${indexCopyOps.join('\n ')} - inputIdx[${this.axis}] = int(_B(indexDataIdx)); + int idx = int(_B(indexDataIdx)); + inputIdx[${axis}] = idx < 0 ? idx + ${inputShape[axis]} : idx; return _A(inputIdx); }`; return { diff --git a/lib/backends/webgl/ops/gemm.ts b/lib/backends/webgl/ops/gemm.ts index 7d2d32f4..15fdf139 100644 --- a/lib/backends/webgl/ops/gemm.ts +++ b/lib/backends/webgl/ops/gemm.ts @@ -14,8 +14,8 @@ export class WebGLGemm extends Gemm implements WebGLOperator { createProgramInfo(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): ProgramInfo { const aShape = inputs[0].dims.slice(); const bShape = inputs[1].dims.slice(); - const cShape = inputs[2].dims.slice(); - const [M, N] = GemmUtil.getShapeOfGemmResult(aShape, this.transA, bShape, this.transB, cShape); + const [M, N] = GemmUtil.getShapeOfGemmResult( + aShape, this.transA, bShape, this.transB, inputs.length === 3 ? inputs[2].dims : undefined); const oShape = [M, N]; if (!oShape) { throw new Error('Can\'t use gemm on the given tensors'); @@ -35,16 +35,18 @@ export class WebGLGemm extends Gemm implements WebGLOperator { line = `value += _A(a) * _B(b);`; } const rank = oShape.length; - const cRank = cShape.length; + const declareC = inputs.length === 3 ? `int c[${inputs[2].dims.length}];` : ''; + const broadcastC = inputs.length === 3 ? `bcastIndices_C(indices, c);` : ''; + const calculateC = inputs.length === 3 ? `value += beta * _C(c);` : ''; const shaderSource = ` float process(int indices[${rank}]) { int a[${rank}]; int b[${rank}]; - int c[${cRank}]; + ${declareC} copyVec(indices, a); copyVec(indices, b); - bcastIndices_C(indices, c); + ${broadcastC} float value = 0.0; for (int k=0; k<${sharedDim}; ++k) { @@ -54,14 +56,14 @@ export class WebGLGemm extends Gemm implements WebGLOperator { } value = value * alpha; - value += beta * _C(c); + ${calculateC} return value; }`; const inputLayouts = inputs.map(t => inferenceHandler.getOrCreateTextureLayout(t)); return { inputLayouts, outputLayout: inferenceHandler.createTextureLayoutFromShape(oShape), - samplers: ['A', 'B', 'C'], + samplers: inputs.length === 3 ? ['A', 'B', 'C'] : ['A', 'B'], variables: [{name: 'alpha', type: 'float'}, {name: 'beta', type: 'float'}], shaderSource, }; diff --git a/lib/backends/webgl/ops/reduce.ts b/lib/backends/webgl/ops/reduce.ts index bc0496aa..c7c07e81 100644 --- a/lib/backends/webgl/ops/reduce.ts +++ b/lib/backends/webgl/ops/reduce.ts @@ -2,11 +2,12 @@ import {ReduceBase} from '../../../ops/reduce-op'; import {Tensor} from '../../../tensor'; +import {ShapeUtil} from '../../../util'; import {WebGLInferenceHandler} from '../inference-handler'; import {ProgramInfo, RunData, WebGLOperator} from '../types'; abstract class WebGLGenericReduce extends ReduceBase implements WebGLOperator { - abstract getOps(inputs: Tensor[]): string[]; + abstract getOps(inputs: Tensor[], axes: number[]): string[]; run(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] { return inferenceHandler.run(this, inputs); @@ -17,12 +18,13 @@ abstract class WebGLGenericReduce extends ReduceBase implements WebGLOperator { const idxCopy = []; // copy output indexes to input indexes - const ops = this.getOps(inputs); // [init ops, reduce ops, final ops] + const axes = ShapeUtil.normalizeAxes(this.axes, inputs[0].dims.length); + const ops = this.getOps(inputs, axes); // [init ops, reduce ops, final ops] let reduceOps = ops[1]; for (let k = 0; k < inputs[0].dims.length; k++) { // if this axis is reduced - if (this.axes.indexOf(k) >= 0 || this.axes.length === 0) { + if (axes.indexOf(k) >= 0 || axes.length === 0) { if (this.keepDims) { outputShape.push(1); } // else { remove the axis from outputShape; } @@ -78,10 +80,10 @@ export class WebGLReduceSum extends WebGLGenericReduce { } export class WebGLReduceMean extends WebGLGenericReduce { - getOps(inputs: Tensor[]): string[] { + getOps(inputs: Tensor[], axes: number[]): string[] { let size = 1.0; for (let k = 0; k < inputs[0].dims.length; k++) { - if (this.axes.indexOf(k) >= 0 || this.axes.length === 0) { + if (axes.indexOf(k) >= 0 || axes.length === 0) { size *= inputs[0].dims[k]; } } @@ -91,10 +93,10 @@ export class WebGLReduceMean extends WebGLGenericReduce { } export class WebGLReduceMax extends WebGLGenericReduce { - getOps(inputs: Tensor[]): string[] { + getOps(inputs: Tensor[], axes: number[]): string[] { const idxZero = []; for (let k = 0; k < inputs[0].dims.length; k++) { - if (this.axes.indexOf(k) >= 0 || this.axes.length === 0) { + if (axes.indexOf(k) >= 0 || axes.length === 0) { idxZero.push(`inputIdx[${k}] = 0;`); // first element } } @@ -104,10 +106,10 @@ export class WebGLReduceMax extends WebGLGenericReduce { } export class WebGLReduceMin extends WebGLGenericReduce { - getOps(inputs: Tensor[]): string[] { + getOps(inputs: Tensor[], axes: number[]): string[] { const idxZero = []; for (let k = 0; k < inputs[0].dims.length; k++) { - if (this.axes.indexOf(k) >= 0 || this.axes.length === 0) { + if (axes.indexOf(k) >= 0 || axes.length === 0) { idxZero.push(`inputIdx[${k}] = 0;`); // first element } } diff --git a/lib/backends/webgl/ops/slice.ts b/lib/backends/webgl/ops/slice.ts index 7a493a67..794e595a 100644 --- a/lib/backends/webgl/ops/slice.ts +++ b/lib/backends/webgl/ops/slice.ts @@ -51,18 +51,18 @@ function createProgramInfo( if (axes.length === 0) { axes = x.dims.slice(0).map((val, ind) => ind); } - axes = axes.map(axis => ShapeUtil.parseAxis(axis, x.dims.length)); + axes = ShapeUtil.normalizeAxes(axes, x.dims.length); starts = starts.map((start, ind) => { if (start > x.dims[axes[ind]] - 1) { return x.dims[axes[ind]]; } - return ShapeUtil.parseAxis(start, x.dims[axes[ind]]); + return ShapeUtil.normalizeAxis(start, x.dims[axes[ind]]); }); ends = ends.map((end, ind) => { if (end > x.dims[axes[ind]] - 1) { return x.dims[axes[ind]]; } - return ShapeUtil.parseAxis(end, x.dims[axes[ind]]); + return ShapeUtil.normalizeAxis(end, x.dims[axes[ind]]); }); const outputShape = x.dims.slice(); diff --git a/lib/backends/webgl/ops/softmax.ts b/lib/backends/webgl/ops/softmax.ts index ba7bfa5c..50832667 100644 --- a/lib/backends/webgl/ops/softmax.ts +++ b/lib/backends/webgl/ops/softmax.ts @@ -180,9 +180,9 @@ export class WebGLSoftmax extends Softmax { } createProgramInfos(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): ProgramInfo[] { const inputShape = inputs[0].dims.slice(); - const axisCorrected = ShapeUtil.parseAxis(this.axis, inputShape.length); - const N = ShapeUtil.sizeToDimension(inputShape, axisCorrected); - const D = ShapeUtil.sizeFromDimension(inputShape, axisCorrected); + const axis = ShapeUtil.normalizeAxis(this.axis, inputShape.length); + const N = ShapeUtil.sizeToDimension(inputShape, axis); + const D = ShapeUtil.sizeFromDimension(inputShape, axis); const computeMaxProgramInfo = this.createComputeMaxProgramInfo(inferenceHandler, inputs[0], N, D, [N]); const computeScaleProgramInfo = this.createComputScaleProgramInfo(inferenceHandler, inputs[0], N, D, computeMaxProgramInfo.outputLayout, [N]); diff --git a/lib/backends/webgl/ops/split.ts b/lib/backends/webgl/ops/split.ts index 3ae4cee1..e7423dd3 100644 --- a/lib/backends/webgl/ops/split.ts +++ b/lib/backends/webgl/ops/split.ts @@ -3,17 +3,18 @@ import {Split} from '../../../ops/split'; import {Tensor} from '../../../tensor'; -import {SplitUtil} from '../../../util'; +import {ShapeUtil, SplitUtil} from '../../../util'; import {WebGLInferenceHandler} from '../inference-handler'; import {Artifact, ProgramInfo, RunData} from '../types'; export class WebGLSplit extends Split { run(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] { - const count = this.getProgramCount(inferenceHandler, inputs); if (!this.artifacts) { this.artifacts = []; + const axis = ShapeUtil.normalizeAxis(this.axis, inputs[0].dims.length); + const count = this.getProgramCount(inferenceHandler, inputs, axis); for (let i = 0; i < count; ++i) { - const programInfo = this.createProgramInfo(inferenceHandler, inputs[0], i); + const programInfo = this.createProgramInfo(inferenceHandler, inputs[0], axis, i); const artifact = inferenceHandler.session.programManager.build(programInfo); this.artifacts.push(artifact); } @@ -27,18 +28,18 @@ export class WebGLSplit extends Split { }); return results; } - getProgramCount(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): number { - const [, offsets] = SplitUtil.splitShape(inputs[0].dims, this.axis, this.split, this.numOutputs); + getProgramCount(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], axis: number): number { + const [, offsets] = SplitUtil.splitShape(inputs[0].dims, axis, this.split, this.numOutputs); return offsets.length; } - createProgramInfo(inferenceHandler: WebGLInferenceHandler, input: Tensor, index: number): ProgramInfo { - const [shapes, offsets] = SplitUtil.splitShape(input.dims, this.axis, this.split, this.numOutputs); + createProgramInfo(inferenceHandler: WebGLInferenceHandler, input: Tensor, axis: number, index: number): ProgramInfo { + const [shapes, offsets] = SplitUtil.splitShape(input.dims, axis, this.split, this.numOutputs); const offset = offsets[index]; const outputShape = shapes[index]; const rank = outputShape.length; const shaderSource = ` float process(int indices[${rank}]) { - indices[${this.axis}] += ${offset}; + indices[${axis}] += ${offset}; return _A(indices); }`; return { diff --git a/lib/ops/flatten.ts b/lib/ops/flatten.ts index 2a7e8cff..88062048 100644 --- a/lib/ops/flatten.ts +++ b/lib/ops/flatten.ts @@ -18,11 +18,12 @@ export abstract class Flatten implements Operator { return false; } - if (inputs[0].dims.length === 0) { + const r = inputs[0].dims.length; + if (r === 0) { return false; // scalar tensor is not supported } - if (this.axis < 0 || this.axis > inputs[0].dims.length) { + if (this.axis < -r || this.axis > r) { return false; } diff --git a/lib/ops/gemm.ts b/lib/ops/gemm.ts index 7758c1a4..90c60188 100644 --- a/lib/ops/gemm.ts +++ b/lib/ops/gemm.ts @@ -7,6 +7,10 @@ import {Operator} from '../operators'; import {Tensor} from '../tensor'; export abstract class Gemm implements Operator { + constructor(isOptionalC: boolean) { + this.isOptionalC = isOptionalC; + } + abstract run(inferenceHandler: InferenceHandler, inputs: Tensor[]): Tensor[]|Promise; initialize(attributes: Attribute): void { @@ -17,12 +21,18 @@ export abstract class Gemm implements Operator { } checkInputs(inputs: Tensor[]): boolean { - if (!inputs || inputs.length !== 3) { + if (!inputs) { + return false; + } + if (this.isOptionalC && (inputs.length < 2 || inputs.length > 3)) { + return false; + } + if (!this.isOptionalC && inputs.length !== 3) { return false; } // 'C' can be of dimensionality 1 or 2 only - if (inputs[2].dims.length !== 1 && inputs[2].dims.length !== 2) { + if (inputs.length === 3 && inputs[2].dims.length !== 1 && inputs[2].dims.length !== 2) { return false; } @@ -32,11 +42,11 @@ export abstract class Gemm implements Operator { protected checkInputTypes(inputs: Tensor[]): boolean { if ((inputs[0].type !== 'float32' && inputs[0].type !== 'float64') || (inputs[1].type !== 'float32' && inputs[1].type !== 'float64') || - (inputs[2].type !== 'float32' && inputs[2].type !== 'float64')) { + (inputs.length === 3 && inputs[2].type !== 'float32' && inputs[2].type !== 'float64')) { return false; } - if ((inputs[0].type !== inputs[1].type) || (inputs[0].type !== inputs[2].type)) { + if ((inputs[0].type !== inputs[1].type) || (inputs.length === 3 && inputs[0].type !== inputs[2].type)) { return false; } @@ -47,4 +57,6 @@ export abstract class Gemm implements Operator { protected transB: boolean; protected alpha: number; protected beta: number; + + protected isOptionalC: boolean; // in opset 11, C becomes optional } diff --git a/lib/util.ts b/lib/util.ts index 83678126..cfab8467 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -278,7 +278,7 @@ export class GemmUtil { // will throw exception if the input shapes are not compatible static getShapeOfGemmResult( leftShape: ReadonlyArray, transLeft: boolean, rightShape: ReadonlyArray, transRight: boolean, - biasShape: ReadonlyArray): ReadonlyArray { + biasShape?: ReadonlyArray): ReadonlyArray { if (leftShape.length !== 2 || rightShape.length !== 2) { throw new Error(`shape need to be of size 2`); } @@ -313,7 +313,7 @@ export class GemmUtil { throw new Error(`invalid shape specified`); } - if (!BroadcastUtil.isValidBroadcast(biasShape, [M, N])) { + if (biasShape && !BroadcastUtil.isValidBroadcast(biasShape, [M, N])) { throw new Error(`gemm: invalid bias shape for broadcast`); } @@ -460,13 +460,20 @@ export class ShapeUtil { return indices; } - static parseAxis(axis: number, tensorRank: number): number { + /** + * normailze axis of range [-r, r) into [0, r). + */ + static normalizeAxis(axis: number, tensorRank: number): number { if (axis < -tensorRank && axis >= tensorRank) { throw new Error('unsupported axis for this operation.'); } return axis < 0 ? axis + tensorRank : axis; } + static normalizeAxes(axes: ReadonlyArray, tensorRank: number): number[] { + return axes.map(x => this.normalizeAxis(x, tensorRank)); + } + // Increment an index into a tensor (in lexicographic // ordering), wrapping around the specified upper_bound. /** @@ -612,7 +619,7 @@ export class ShapeUtil { if (!Number.isInteger(n)) { throw new TypeError(`Invalid shape: ${n} is not an integer`); } - if (n <= 0 || n > 2147483647) { + if (n < 0 || n > 2147483647) { throw new TypeError(`Invalid shape: length ${n} is not allowed`); } size *= n; @@ -623,9 +630,12 @@ export class ShapeUtil { /** * Determines the shape of output tensor y = flatten(x, axis) * @param dims - shape of input tensor - * @param axis - flatten axis + * @param axis - flatten axis, in the range [-r, r] */ static flattenShape(dims: ReadonlyArray, axis: number): ReadonlyArray { + if (axis < 0) { + axis += dims.length; + } const total = dims.reduce((x, y) => x * y, 1); const right = dims.slice(axis).reduce((x, y) => x * y, 1); const outputDims = [total / right, right]; @@ -642,9 +652,7 @@ export class ShapeUtil { const outputDims = new Array(); // sanity check - if (axes.some(axis => axis >= dims.length || axis < 0)) { - throw new Error(`'axes' has an out of range axis`); - } + axes = ShapeUtil.normalizeAxes(axes, dims.length); for (let i = 0; i < dims.length; i++) { const inSqueezeList = axes.indexOf(i) >= 0; @@ -673,7 +681,7 @@ export class ShapeUtil { // set all axes indices to 1 in outputDims and check for duplicates for (let i = 0; i < axes.length; i++) { - const axis = axes[i]; + const axis = ShapeUtil.normalizeAxis(axes[i], dims.length); if (axis >= outputDims.length) { throw new Error(`'axes' has an out of range axis`); } diff --git a/tools/gen-doc.ts b/tools/gen-doc.ts index 798efa53..2ad3f027 100644 --- a/tools/gen-doc.ts +++ b/tools/gen-doc.ts @@ -17,7 +17,7 @@ import {OpSet, resolveOperator} from '../lib/opset'; // tslint:disable: non-literal-fs-path -https.get('https://raw.githubusercontent.com/onnx/onnx/v1.5.0/onnx/defs/operator_sets.h', res => { +https.get('https://raw.githubusercontent.com/onnx/onnx/v1.7.0/onnx/defs/operator_sets.h', res => { const rl = readline.createInterface({input: res}); const matcher = /class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME\(\s*(\w+),\s*(\d+),\s*(\w+)\)/; @@ -73,7 +73,7 @@ https.get('https://raw.githubusercontent.com/onnx/onnx/v1.5.0/onnx/defs/operator doc.write(`| Operator | Cpu Backend | Wasm Backend | WebGl Backend |${EOL}`); doc.write(`|:--------:|:-----------:|:------------:|:-------------:|${EOL}`); - const VERSION_MAX = 10; + const VERSION_MAX = 12; for (const type of opTypes) { const versions = onnxOpset.get(type)!.sort((a, b) => a - b); @@ -116,10 +116,7 @@ function formatDesc(opType: string, range: [number, number], support: boolean, l let versionDesc = ''; if (support) { versionDesc = last ? `${range[0]}+` : range[0] === range[1] ? `${range[0]}` : `${range[0]}-${range[1]}`; + versionDesc = `[${versionDesc}](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#${opType}-${range[0]})`; } - // if (!last) { - // versionDesc = - // `[${versionDesc}](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#${opType}-${range[0]})`; - // } return versionDesc; }