Metadata-Version: 2.1
Name: onnion-rt
Version: 0.4.0
Summary: run onnx with only numpy
Home-page: https://github.com/Idein/onnion/tree/master/runtime
License: Apache-2.0
Keywords: onnx
Author: Idein Inc.
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: numpy (>=1.19.0,<2.0.0)
Project-URL: Repository, https://github.com/Idein/onnion/tree/master/runtime
Description-Content-Type: text/markdown

# onnion-rt

Note: This software includes [the work](https://github.com/onnx/onnx) that is distributed in the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).

## Installation

```
$ pip3 install onnion-rt
```

## Usage
See [tutorial](https://github.com/Idein/onnion/tree/master#tutorial).

## Development Guide

```
$ poetry install
```

### How to support new operators

1. Add `onnion_runtime/xxx.py`
  - An onnx operator `Xxx` must correspond to a class `Xxx`.
  - A class `Xxx` must implement `__init__` and `run` methods.
  - The parameters of the `__init__` methods must be `self`, `opset_version`, and `kwargs`.
  - The attributes of the operator must be passed through the `kwargs` of the `__init__` method.
    - Get the required attributes by `kwargs['attr_name']`.
    - Get the optional attributes by `kwargs.get('attr_name', default_value)`.
  - The inputs of the operator must be passed through the arguments of the `run` method.
  - The `run` method must return the list of `np.array`.
2. Add `from .xxx import Xxx # noqa: F401` to `onnion_runtime/__init__.py`
3. Update "Supported Operators" in `README.md`
4. Add `tests/test_xxx.py`
5. Run tests `poetry run pytest -v`
6. Format and lint `poetry run pysen run format && poetry run pysen run lint`

## Supported Operators
This runtime supports only below operators.

- Abs
- Acos
- Acosh
- Add
  - must be from opsetversion >= 7
- And
  - must be from opsetversion >= 7
- ArgMax
- ArgMin
- Asin
- Asinh
- Atan
- Atanh
- BitShift
- Cast
  - must be from opsetversion >= 6
- Ceil
- Celu
- Clip
- Compress
- Concat
- ConcatFromSequence
- Constant
- ConstantOfShape
- Cos
- Cosh
- DepthToSpace
- DequantizeLinear
- Det
- Div
  - must be from opsetversion >= 7
- Dropout
- DynamicQuantizeLinear
- Einsum
- Elu
- Equal
  - must be from opsetversion >= 7
- Erf
- Exp
- Expand
- EyeLike
- Flatten
- Floor
- Gather
- GatherElements
- GahterND
- Gemm
  - must be from opsetversion >= 7
- GlobalAveragePool
- GlobalMaxPool
- Greater
  - must be from opsetversion >= 7
- GreaterOrEqual
- HardSigmoid
- HardSwish
- Hardmax
- Identity
- If
- InstanceNormalization
- IsInf
- IsNaN
- LeakyRelu
- Loop
- Mul
  - must be from opsetversion >= 7
- NonMaxSuppression
- NonZero
- Pad
- Range
- ReduceMax
- ReduceMin
- Reshape
- Round
- ScatterND
- Shape
- Sigmoid
- Slice
- Squeeze
- Sub
  - must be from opsetversion >= 7
- Tile
  - must be from opsetversion >= 6
- TopK
- Transpose
- Unsqueeze
- Where

