ONNX-1.6.0-OP-Library算字库
ONNX-1.6.0-OP-Library
Build and verify ONNX Opeartors using Python.
This repository contains the python implementation of 130 + operators from ONNX operators list. This was built w.r.t ONNX 1.6.0 version.
Documentation.
ONNX Operator's List:[https://github.com/onnx/onnx/blob/master/docs/Operators.md]
Use
The following things can be achived by using this library of operators.
create the onnx operator and make modifications of your choice with the configurations available for that op from the onnx operators page.
save the ONNX model to your disk.
Run the operator with random input data and get the output using ONNXRuntime Framework [https://github.com/microsoft/onnxruntime/].
Compare the output generated from ONNXRuntime with the actual output (numpy output)
Prerequisites
Method 1: using conda environment in python
Install miniconda or conda in your machine.
step 1: Activate conda environment
source miniconda3/bin/activate
step 2: create virtual environment and install python >= 3.6
conda create -n onnx python=3.6
step 3: Activate the newly created venv.
To activate this environment, use
$ conda activate onnx
To deactivate an active environment, use
$ conda deactivate
step 4: verifiy python version and python installation path
$ python --version
$ which python
step 5: pip install onnx library
pip3 install onnx==1.6
Method 2: using pip install
pip3 install requirements.txt
Note: After Installation, make sure the two python libraries are installed: onnx and onnxruntime
pip3 list
Usage
step 1:
Make sure you are at this path:
> cd ONNX-1.6.0-OP-Library/operators
step 2: Run any operator of your choice
> python3 <op.py>
Example: python3 Abs.py
The models get saved and loaded from this directory.
ONNX-1.6.0-OP-Library/onnx_generated_models/
About
This repository contains the python implementation of 130 + operators from ONNX operators list. This was built w.r.t ONNX 1.6.0.
Resources
Readme
License
View license
Stars
1 star
Watchers
0 watching
Forks
0 forks
Report repository
Releases
No releases published
Packages
No packages published
Languages
Python
100.0%
Footer
© 2023 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Operator Schemas
This file is automatically generated from the def files via this script. Do not modify directly and instead edit operator definitions.
For an operator input/output's differentiability, it can be differentiable, non-differentiable, or undefined. If a variable's differentiability is not specified, that variable has undefined differentiability.
ai.onnx (default)
Operator Since version
Abs 13, 6, 1
Acos 7
Acosh 9
Add 14, 13, 7, 6, 1
And 7, 1
ArgMax 13, 12, 11, 1
ArgMin 13, 12, 11, 1
Asin 7
Asinh 9
Atan 7
Atanh 9
AveragePool 19, 11, 10, 7, 1
BatchNormalization 15, 14, 9, 7, 6, 1
BitShift 11
BitwiseAnd 18
BitwiseNot 18
BitwiseOr 18
BitwiseXor 18
Cast 19, 13, 9, 6, 1
Ceil 13, 6, 1
Col2Im 18
Compress 11, 9
Concat 13, 11, 4, 1
ConcatFromSequence 11
Constant 19, 13, 12, 11, 9, 1
ConstantOfShape 9
Conv 11, 1
ConvInteger 10
ConvTranspose 11, 1
Cos 7
Cosh 9
CumSum 14, 11
DFT 17
DeformConv 19
DepthToSpace 13, 11, 1
DequantizeLinear 19, 13, 10
Det 11
Div 14, 13, 7, 6, 1
Dropout 13, 12, 10, 7, 6, 1
Einsum 12
Equal 19, 13, 11, 7, 1
Erf 13, 9
Exp 13, 6, 1
Expand 13, 8
EyeLike 9
Flatten 13, 11, 9, 1
Floor 13, 6, 1
GRU 14, 7, 3, 1
Gather 13, 11, 1
GatherElements 13, 11
GatherND 13, 12, 11
Gemm 13, 11, 9, 7, 6, 1
GlobalAveragePool 1
GlobalLpPool 2, 1
GlobalMaxPool 1
Greater 13, 9, 7, 1
GridSample 20, 16
Hardmax 13, 11, 1
Identity 19, 16, 14, 13, 1
If 19, 16, 13, 11, 1
InstanceNormalization 6, 1
IsInf 10
IsNaN 13, 9
LRN 13, 1
LSTM 14, 7, 1
Less 13, 9, 7, 1
Log 13, 6, 1
Loop 19, 16, 13, 11, 1
LpNormalization 1
LpPool 18, 11, 2, 1
MatMul 13, 9, 1
MatMulInteger 10
Max 13, 12, 8, 6, 1
MaxPool 12, 11, 10, 8, 1
MaxRoiPool 1
MaxUnpool 11, 9
Mean 13, 8, 6, 1
MelWeightMatrix 17
Min 13, 12, 8, 6, 1
Mod 13, 10
Mul 14, 13, 7, 6, 1
Multinomial 7
Neg 13, 6, 1
NonMaxSuppression 11, 10
NonZero 13, 9
Not 1
OneHot 11, 9
Optional 15
OptionalGetElement 18, 15
OptionalHasElement 18, 15
Or 7, 1
Pad 19, 18, 13, 11, 2, 1
Pow 15, 13, 12, 7, 1
QLinearConv 10
QLinearMatMul 10
QuantizeLinear 19, 13, 10
RNN 14, 7, 1
RandomNormal 1
RandomNormalLike 1
RandomUniform 1
RandomUniformLike 1
Reciprocal 13, 6, 1
ReduceMax 18, 13, 12, 11, 1
ReduceMean 18, 13, 11, 1
ReduceMin 18, 13, 12, 11, 1
ReduceProd 18, 13, 11, 1
ReduceSum 13, 11, 1
Reshape 19, 14, 13, 5, 1
Resize 19, 18, 13, 11, 10
ReverseSequence 10
RoiAlign 16, 10
Round 11
STFT 17
Scan 19, 16, 11, 9, 8
Scatter (deprecated) 11, 9
ScatterElements 18, 16, 13, 11
ScatterND 18, 16, 13, 11
SequenceAt 11
SequenceConstruct 11
SequenceEmpty 11
SequenceErase 11
SequenceInsert 11
SequenceLength 11
Shape 19, 15, 13, 1
Sigmoid 13, 6, 1
Sign 13, 9
Sin 7
Sinh 9
Size 19, 13, 1
Slice 13, 11, 10, 1
SpaceToDepth 13, 1
Split 18, 13, 11, 2, 1
SplitToSequence 11
Sqrt 13, 6, 1
Squeeze 13, 11, 1
StringNormalizer 10
Sub 14, 13, 7, 6, 1
Sum 13, 8, 6, 1
Tan 7
Tanh 13, 6, 1
TfIdfVectorizer 9
Tile 13, 6, 1
TopK 11, 10, 1
Transpose 13, 1
Trilu 14
Unique 11
Unsqueeze 13, 11, 1
Upsample (deprecated) 10, 9, 7
Where 16, 9
Xor 7, 1
Function Since version Function version
Bernoulli 15 15
BlackmanWindow 17 17
CastLike 19, 15 19
Celu 12 12
CenterCropPad 18 18
Clip 13, 12, 11, 6, 1 13
DynamicQuantizeLinear 11 11
Elu 6, 1 18
GreaterOrEqual 16, 12 16
GroupNormalization 18 18
HammingWindow 17 17
HannWindow 17 17
HardSigmoid 6, 1 18
HardSwish 14 14
LayerNormalization 17 17, 18
LeakyRelu 16, 6, 1 16
LessOrEqual 16, 12 16
LogSoftmax 13, 11, 1 13, 18
MeanVarianceNormalization 13, 9 13, 18
Mish 18 18
NegativeLogLikelihoodLoss 13, 12 13
PRelu 16, 9, 7, 6, 1 16
Range 11 11
ReduceL1 18, 13, 11, 1 18
ReduceL2 18, 13, 11, 1 18
ReduceLogSum 18, 13, 11, 1 18
ReduceLogSumExp 18, 13, 11, 1 18
ReduceSumSquare 18, 13, 11, 1 18
Relu 14, 13, 6, 1 18
Selu 6, 1 18
SequenceMap 17 17
Shrink 9 18
Softmax 13, 11, 1 13, 18
SoftmaxCrossEntropyLoss 13, 12 13
Softplus 1 18
Softsign 1 18
ThresholdedRelu 10 18
ai.onnx.preview.training
Operator Since version
ai.onnx.preview.training.Adagrad 1
ai.onnx.preview.training.Adam 1
ai.onnx.preview.training.Gradient 1
ai.onnx.preview.training.Momentum 1
参考文献链接
https://github.com/onnx/onnx/blob/main/docs/Operators.md