Skip to main content

Simplified APIs for onnxruntime

Project description

onnxruntime-easy

Simplified APIs for onnxruntime

Usage

import onnxruntime_easy as ort_easy
import numpy as np
import ml_dtypes

# Simple `load` method that handles setting up ONNX Runtime inference session
# All session options discoverable in the load function.
model = ort_easy.load("model.onnx", device="cpu")  # You can control the providers if the default is not what you need
# Supports all ONNX dtypes via ml_dtypes or dlpack
input = ort_easy.ort_value(np.random.rand(1, 3, 299, 299).astype(ml_dtypes.bfloat16))
output = model(input)

# Works with any ndarray that implements the __array__ interface
# Or automatically share data on device (like cuda) with dlpack
import torch
model = ort_easy.load("model.onnx", device="cuda")
input_tensor = ort_easy.ort_value(torch.rand(1, 3, 299, 299, device="cuda"))
output = model(input_tensor)

# Use a context manager to control the outputs you get
with model.set_outputs("output1"):
    output1 = model(input_tensor)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnxruntime_easy-0.0.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onnxruntime_easy-0.0.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file onnxruntime_easy-0.0.3.tar.gz.

File metadata

  • Download URL: onnxruntime_easy-0.0.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for onnxruntime_easy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3b91b4e7ef58ef7f820a0a9da1f789d9dc9573cfb0b51089a492c67987cd8150
MD5 19a44cf3dc339fda1c2dfb4b98911635
BLAKE2b-256 9e6ecdc9e229541f8ca43982f5416e604125a37d7fc35c06b91e14cd9dfa0d19

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxruntime_easy-0.0.3.tar.gz:

Publisher: main.yml on justinchuby/onnxruntime-easy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxruntime_easy-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for onnxruntime_easy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d070890c7f396ed14d9f386b2cfd32b4cd799c03e34ef6cf94ae603a6e85189
MD5 8693526c3b40d1bee623f51ef0e03b19
BLAKE2b-256 ed52b31ceb16f207541fce0e18bb488fb5632134658206802f993b7990aaad87

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxruntime_easy-0.0.3-py3-none-any.whl:

Publisher: main.yml on justinchuby/onnxruntime-easy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page