Skip to main content

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

  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.
  1. Add from .xxx import Xxx # noqa: F401 to onnion_runtime/__init__.py
  2. Update "Supported Operators" in README.md
  3. Add tests/test_xxx.py
  4. Run tests poetry run pytest -v
  5. 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
  • BatchNormalization
    • must be from opsetversion >= 9
  • BitShift
  • Cast
    • must be from opsetversion >= 6
  • Ceil
  • Celu
  • Clip
  • Compress
  • Concat
  • ConcatFromSequence
  • Constant
  • ConstantOfShape
  • ConvTranspose
    • support 2d only
    • group should be 1
    • auto_pad should be "NOTSET" (default value)
  • 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
  • Less
    • must be from opsetversion >= 7
  • LessOrEqual
  • Log
  • LogSoftmax
  • Loop
  • MatMul
  • MatMulInteger
  • Max
  • Mean
  • Min
  • Mod
  • Mul
    • must be from opsetversion >= 7
  • Neg
  • NegativeLogLikelihoodLoss
  • NonMaxSuppression
  • NonZero
  • Not
  • OneHot
  • Or
    • must be from opsetversion >= 7
  • PRelu
  • Pad
  • Pow
    • must be from opsetversion >= 7
  • RandomNormal
  • RandomNormalLike
  • RandomUniform
  • RandomUniformLike
  • Range
  • Reciprocal
  • ReduceL1
  • ReduceL2
  • ReduceLogSum
  • ReduceLogSumExp
  • ReduceMax
  • ReduceMean
  • ReduceMin
  • ReduceProd
  • ReduceSum
  • ReduceSumSquare
  • Relu
  • Reshape
  • Round
  • ScatterND
  • Shape
  • Sigmoid
  • Slice
  • Softmax
  • Split
    • argument split must be specified
  • Sqrt
  • Squeeze
  • Sub
    • must be from opsetversion >= 7
  • Tile
    • must be from opsetversion >= 6
  • TopK
  • Transpose
  • Unsqueeze
  • Where

Metadata

Release files for onnion-rt 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onnion-rt 0.8.0
File Size Uploaded Provenance
onnion_rt-0.8.0.tar.gz 22.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for onnion-rt 0.8.0
File Interpreter ABI Platform
onnion_rt-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 77.1 kB

Release files / onnion_rt-0.8.0.tar.gz

Download URL onnion_rt-0.8.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4f7971d9a91257bc7b34098c43be5ade2e469c2cbbf70652bfe859f7ccad510a
BLAKE2b-256 checksum
How to use checksums
cb2fe7e1112fbd78f5b5fa188ba8c51d065315b8da566293215183da4cdae63b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1039-aws

Release files / onnion_rt-0.8.0-py3-none-any.whl

Download URL onnion_rt-0.8.0-py3-none-any.whl
Size 55.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ed9854530605e790e4d875f605fc06892066884f6fa3d30d51a281d76dc0b09
BLAKE2b-256 checksum
How to use checksums
279eb35a4e4a16ed120bde44cc55c0e36132821fd8ad03d61e06d681d35a5c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1039-aws

Security for onnion-rt 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page