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.1.0.tar.gz (6.1 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.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onnxruntime_easy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef4ece8192f8c886475c1991723e82c6eaaf6f2de30c3fb680d80f4ca596d9fe
MD5 4617d17eb06eefbc59bb517b73aaae5e
BLAKE2b-256 965d8423c2fc67e6dca889e5681c5f09b0a52a2423b053fdb29831594ab62419

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxruntime_easy-0.1.0.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for onnxruntime_easy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20fc6b1bc3493692abce4993c73dcc53c0282d9bf872ead42580d4685ea23d3e
MD5 d80fceaf64c44bf737ab01962f99b278
BLAKE2b-256 1a398e32f36cd227e0ff45ce6b9f2c8312425fa7d71e2d81730167ea2e4cb5ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxruntime_easy-0.1.0-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