pub struct OnnxOptions {
pub backend: BackendSelection,
pub tensorrt: Option<TensorRtOptions>,
pub cuda: Option<CudaOptions>,
pub intra_threads: usize,
pub inter_threads: usize,
pub parallel_execution: bool,
pub dimension_overrides: BTreeMap<String, usize>,
pub profiling: Option<PathBuf>,
}Expand description
Backend selection, threading, profiling, and model-shape configuration.
ONNX Runtime is loaded once per process through the system library loader.
Set ORT_DYLIB_PATH before starting the process to override its location.
Fields§
§backend: BackendSelectionRequired provider or ordered fallback candidates; defaults depend on the platform.
tensorrt: Option<TensorRtOptions>Optional TensorRT overrides. None uses TensorRtOptions::default() when selected.
Ignored by other providers; does not enable/disable TensorRT.
cuda: Option<CudaOptions>Optional CUDA overrides. None uses CudaOptions::default() when selected.
Ignored by other providers; does not enable/disable CUDA.
intra_threads: usizeThreads within an operator, default 1; 0 lets ONNX Runtime choose.
inter_threads: usizeThreads across operators, default 1; used with parallel ORT execution.
parallel_execution: boolExecute independent operators in parallel, default false.
Enables inter_threads; CUDA graph capture is disabled in this mode.
dimension_overrides: BTreeMap<String, usize>Resolve symbolic ONNX dimensions to fixed sizes, enabling the prepared path.
profiling: Option<PathBuf>Optional ORT profiling prefix. Leave unset for timing measurements.