run onnx with only numpy
Project description
onnion-rt
Note: This software includes the work that is distributed in the Apache License 2.0.
Installation
$ pip3 install onnion-rt
Usage
See tutorial.
Development Guide
$ poetry install
How to support new operators
- Add
onnion_runtime/xxx.py
- An onnx operator
Xxx
must correspond to a classXxx
. - A class
Xxx
must implement__init__
andrun
methods. - The parameters of the
__init__
methods must beself
,opset_version
, andkwargs
. - 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)
.
- Get the required attributes by
- The inputs of the operator must be passed through the arguments of the
run
method. - The
run
method must return the list ofnp.array
.
- Add
from .xxx import Xxx # noqa: F401
toonnion_runtime/__init__.py
- Update "Supported Operators" in
README.md
- Add
tests/test_xxx.py
- Run tests
poetry run pytest -v
- Format and lint
poetry run pysen run format && poetry run pysen run lint
Supported Operators
This runtime supports only below operators.
- Add
- must be from opsetversion >= 7
- Cast
- must be from opsetversion >= 6
- Concat
- Div
- must be from opsetversion >= 7
- Exp
- Gather
- Mul
- must be from opsetversion >= 7
- NonMaxSuppression
- ReduceMin
- Reshape
- Shape
- Slice
- Squeeze
- Sub
- must be from opsetversion >= 7
- TopK
- Unsqueeze
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
onnion-rt-0.2.0.tar.gz
(6.6 kB
view hashes)
Built Distribution
onnion_rt-0.2.0-py3-none-any.whl
(10.9 kB
view hashes)
Close
Hashes for onnion_rt-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5009625e0f476ad0ac4700e83d4bc0cd271b9d8e2193a3300a1b25a66a1860f1 |
|
MD5 | 658a154c87adc1a544911c955fac7987 |
|
BLAKE2b-256 | 76b6405f92277c3879af8c3d9845d3c6289739c1774a2f2f303938b1ad9620d7 |