Share via


OnnxSessionOptions Class

Definition

public sealed class OnnxSessionOptions
type OnnxSessionOptions = class
Public NotInheritable Class OnnxSessionOptions
Inheritance
OnnxSessionOptions

Constructors

OnnxSessionOptions()

Fields

LogSeverityLevel

Log Severity Level for the session logs. Default = ORT_LOGGING_LEVEL_WARNING

Properties

CreateSessionOptions
EnableCpuMemArena

Enables Arena allocator for the CPU memory allocations. Default is true.

EnableMemoryPattern

Enables the use of the memory allocation patterns in the first Run() call for subsequent runs. Default = true.

EnableProfiling

Enables profiling of InferenceSession.Run() calls. Default is false

ExecutionMode

Sets the execution mode for the session. Default is set to ORT_SEQUENTIAL. See [ONNX_Runtime_Perf_Tuning.md] for more details.

GlobalInterOpNumThreads

Sets the number of threads used to parallelize the execution of the graph (across nodes) If sequential execution is enabled this value is ignored A value of 0 means ORT will pick a default. Only used when PerSessionThreads is false.

GlobalIntraOpNumThreads

Sets the number of threads used to parallelize the execution within nodes A value of 0 means ORT will pick a default. Only used when PerSessionThreads is false.

GraphOptimizationLevel

Sets the graph optimization level for the session. Default is set to ORT_ENABLE_ALL.

InterOpNumThreads

Sets the number of threads used to parallelize the execution of the graph (across nodes) If sequential execution is enabled this value is ignored A value of 0 means ORT will pick a default

IntraOpNumThreads

Sets the number of threads used to parallelize the execution within nodes A value of 0 means ORT will pick a default

LogId

Log Id to be used for the session. Default is empty string.

LogVerbosityLevel

Log Verbosity Level for the session logs. Default = 0. Valid values are >=0. This takes into effect only when the LogSeverityLevel is set to ORT_LOGGING_LEVEL_VERBOSE.

OptimizedModelFilePath

Set filepath to save optimized model after graph level transformations. Default is empty, which implies saving is disabled.

PerSessionThreads

Per session threads. Default is true. If false this makes all sessions in the process use a global TP.

ProfileOutputPathPrefix

Path prefix to use for output of profiling data

Applies to