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.1.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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onnxruntime_easy-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5b7e39bd023bd92cf79e0667880af1d0657aa647ed401ed84ea31aaafa65e8b5
MD5 69ab5573bb947ee3730575b649eac8ab
BLAKE2b-256 1e743b916187ebf2aaee161e4561a504730dce1ead97d4528a4cb678f6c99b5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for onnxruntime_easy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93b5a85ee80f01570b3f40d1b69afb193e7d3a27f26eecda7d54a584e6ea7bc6
MD5 081879ae00a762842a0e40772a9e1236
BLAKE2b-256 a3dbd19c7cae76197b72102f24a2d661466b8b0eedf218960a0f55d71a836529

See more details on using hashes here.

Provenance

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