OrtSessionOptions class

Constructors

OrtSessionOptions()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

appendCANNProvider([Map<String, String>? options]) bool
Appends CANN provider (Huawei Ascend AI processor). Optimized for Huawei Ascend NPUs.
appendCoreMLProvider(CoreMLFlags flags) bool
Appends CoreML provider (Apple Neural Engine/GPU acceleration). Best for iOS/macOS devices with Apple Silicon or A-series chips.
appendCPUProvider(CPUFlags flags) bool
Appends cpu provider.
appendCudaProvider(CUDAFlags flags) bool
Appends CUDA provider (NVIDIA GPU acceleration). Requires NVIDIA GPU with CUDA runtime installed. Typically 5-10x faster than CPU for deep learning workloads.
appendDefaultProviders() Future<void>
Automatically selects and appends the best available execution provider.
appendDirectMLProvider([Map<String, String>? options]) bool
Appends DirectML provider (DirectX 12 GPU acceleration). Works on Windows with AMD, Intel, or NVIDIA GPUs. Great for cross-vendor GPU support on Windows.
appendDNNLProvider(DNNLFlags flags) bool
Appends DNNL provider (Intel Deep Neural Network Library). Optimized CPU operations for Intel processors. Good CPU performance boost on Intel hardware.
appendMIGraphXProvider(MIGraphXFlags flags) bool
Appends MIGraphX provider (AMD graph optimization). AMD's graph-level optimizations for their GPUs.
appendNnapiProvider(NnapiFlags flags) bool
Appends Nnapi provider (Android Neural Networks API). Google's Android acceleration - works on Android 8.1+.
appendOpenVINOProvider([Map<String, String>? options]) bool
Appends OpenVINO provider (Intel hardware optimization). Optimized for Intel CPUs, integrated GPUs, and VPUs. Great performance boost on Intel hardware.
appendQnnProvider() bool
Appends QNN provider (Qualcomm Neural Network). Optimized for Qualcomm Snapdragon chips with Hexagon DSP/NPU.
appendRocmProvider(ROCmFlags flags) bool
Appends ROCm provider (AMD GPU acceleration). Requires AMD GPU with ROCm runtime installed (Linux only).
appendTensorRTProvider([Map<String, String>? options]) bool
Appends TensorRT provider (NVIDIA GPU with optimizations). Requires NVIDIA GPU with TensorRT runtime installed. Can be 2-5x faster than raw CUDA with additional optimizations. Supports FP16 and INT8 quantization for even faster inference.
appendXnnpackProvider() bool
Appends Xnnpack provider (Optimized CPU operations). Cross-platform CPU optimization, works on all platforms.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() → void
setInterOpNumThreads(int numThreads) → void
Sets the number of inter-op threads used by ONNX Runtime.
setIntraOpNumThreads(int numThreads) → void
Sets the number of intra-op threads used by ONNX Runtime.
setSessionExecutionMode(OrtSessionExecutionMode mode) → void
Sets the execution mode for the session. Sequential mode runs operations one at a time. Parallel mode allows operations to run in parallel when possible.
setSessionGraphOptimizationLevel(GraphOptimizationLevel level) → void
Sets the level of session graph optimization.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited