bindings of sonos/tract rust NN inference enging for python
Project description
tract-python
Tract inference engine bindings in Python via FFI.
Why
Tract Cli is very feature-full but reloading a model each time you wish to do an inference is computationaly costy and slow.
Install
Install using pip:
pip install tract_python
Usage
import tract_python
tract_model = tract_python.TractModel.load_plan_from_nnef_dir(
'./test_simple_nnef/'
)
results = tm.run(input_0=np.arange(6).reshape(1, 2, 3).astype(np.float32))
print(results)
#{'output_0': array([[[ 0., 2., 4.],
# [ 6., 8., 10.]]], dtype=float32)}
Status
This project is in alpha state.
Scope
My personnal usecase is to be able to run benchmarks (+10M inferences) with 'tract' engine.
Ideally I would like to support most of the tract-cli
features:
- load NNEF dir
- run simple plan
- load all supported formats: ONNX, TF, from HTTP, from .tgz
- expose computations of model informations:
- number of parameters
- size on disk
- profiling infos
That said I do not have the bandwith to do it up-front. I welcome any contributor that would wish to add more features.
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
tract_python-0.2.0.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for tract_python-0.2.0-py3-none-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e915353009649b9ef668df8f604654bf2753afaaa26510ea414e7e7a95c73401 |
|
MD5 | 220cb33ce638031f2fd547722b40b94f |
|
BLAKE2b-256 | b48d9ea923e9faea0543b218bc12d59963842a98e0fce2005f96fa795afec361 |