TensorStack.OnnxRuntime
0.15.0
Prefix Reserved
dotnet add package TensorStack.OnnxRuntime --version 0.15.0
NuGet\Install-Package TensorStack.OnnxRuntime -Version 0.15.0
<PackageReference Include="TensorStack.OnnxRuntime" Version="0.15.0" />
<PackageVersion Include="TensorStack.OnnxRuntime" Version="0.15.0" />
<PackageReference Include="TensorStack.OnnxRuntime" />
paket add TensorStack.OnnxRuntime --version 0.15.0
#r "nuget: TensorStack.OnnxRuntime, 0.15.0"
#:package TensorStack.OnnxRuntime@0.15.0
#addin nuget:?package=TensorStack.OnnxRuntime&version=0.15.0
#tool nuget:?package=TensorStack.OnnxRuntime&version=0.15.0
TensorStack.OnnxRuntime
TensorStack.OnnxRuntime is the ONNX Runtime layer used by TensorStack.OnnxRuntime.Vision and TensorStack.OnnxRuntime.LLM.
Nuget Package
It manages devices, execution providers and model sessions, and handles input type conversion and the creation, use and disposal of OrtValue objects.
Providers
Provider uses the DirectML execution provider, and initializes itself on first use.
// Best GPU
ExecutionProvider provider = Provider.GetProvider();
// By device type, or device type and id
ExecutionProvider cpuProvider = Provider.GetProvider(DeviceType.CPU);
ExecutionProvider gpuProvider = Provider.GetProvider(DeviceType.GPU, deviceId: 1);
// List devices
foreach (var device in Provider.GetDevices())
{
Console.WriteLine($"{device.Type}: {device.Name}");
}
Model Sessions
ModelSession loads an ONNX model from a ModelConfig and runs inference.
var config = new ModelConfig
{
Path = "model.onnx",
ExecutionProvider = Provider.GetProvider()
};
using (var session = new ModelSession(config))
{
ModelMetadata metadata = await session.LoadAsync();
using (var parameters = new ModelParameters(metadata))
{
// Inputs are added in model input order
parameters.AddInput(imageTensor.GetChannels(3), Normalization.ZeroToOne);
parameters.AddOutput(new[] { 1, 3, height * 4, width * 4 });
using (var results = await session.RunInferenceAsync(parameters))
{
// Read outputs
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.17763 is compatible. |
-
net10.0-windows10.0.17763
- Microsoft.ML.OnnxRuntime.DirectML (>= 1.24.4)
- Microsoft.ML.OnnxRuntime.Managed (>= 1.30.0)
- TensorStack.Common (>= 0.15.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TensorStack.OnnxRuntime:
| Package | Downloads |
|---|---|
|
TensorStack.OnnxRuntime.Vision
Image and video upscaling for .NET using ONNX Runtime. |
|
|
TensorStack.OnnxRuntime.LLM
Text generation for .NET using ONNX Runtime. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.15.0 | 56 | 11/18/2026 |
| 0.14.14 | 65 | 11/17/2026 |
| 0.14.13 | 102 | 11/16/2026 |
| 0.14.12 | 101 | 11/15/2026 |
| 0.14.11 | 99 | 11/15/2026 |
| 0.14.10 | 108 | 11/14/2026 |
| 0.14.9 | 101 | 11/13/2026 |
| 0.14.8 | 102 | 11/10/2026 |
| 0.14.7 | 101 | 11/8/2026 |
| 0.14.6 | 108 | 11/5/2026 |
| 0.14.5 | 125 | 11/1/2026 |
| 0.14.4 | 182 | 10/29/2026 |
| 0.14.3 | 116 | 10/28/2026 |
| 0.14.2 | 158 | 10/20/2026 |
| 0.14.1 | 139 | 10/16/2026 |
| 0.13.13 | 130 | 10/11/2026 |
| 0.13.12 | 123 | 10/10/2026 |
| 0.13.10 | 134 | 10/6/2026 |
| 0.13.9 | 118 | 10/5/2026 |
| 0.13.8 | 126 | 10/4/2026 |