Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cbourjau/ort-custom-op
Rust framework for writing custom operations for the onnxruntime
https://github.com/cbourjau/ort-custom-op
Last synced: about 1 month ago
JSON representation
Rust framework for writing custom operations for the onnxruntime
- Host: GitHub
- URL: https://github.com/cbourjau/ort-custom-op
- Owner: cbourjau
- License: bsd-3-clause
- Created: 2022-08-12T12:48:28.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T16:42:53.000Z (4 months ago)
- Last Synced: 2024-11-06T20:10:41.572Z (about 2 months ago)
- Language: Rust
- Size: 199 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Proof of concept for writing custom operators for onnxruntime
=============================================================Custom operators can be made available to the onnxruntime by creating a shared library with a standardized API.
Directly interfacing with the API and types exposed by onnxruntime is quite cumbersome and error prone, though.
This project provides abstractions that make this interfacing much easier and safe.Each custom operator is an individual type which implements the `CustomOp` trait. Types which implement that trait can be `build` into static objects which are in turn exposed to the onnxruntime.
The `example` crate demonstrates how to implement various custom operators.
These operators are loaded and used in the Python test cases in `tests/python`.
Building and running these tests requires `cargo` (i.e. the standard rust tool chain), `onnxruntime` and `pytest`.Execute the following at the root of this repository to build the shared
library and to run the python-defined tests:```python
cargo b && pytest tests/python -s
```