Show / Hide Table of Contents

Class RunOptions

Sets various runtime options.

Inheritance
Object
CriticalFinalizerObject
SafeHandle
RunOptions
Implements
IDisposable
Inherited Members
SafeHandle.handle
SafeHandle.Close()
SafeHandle.DangerousAddRef(Boolean)
SafeHandle.DangerousGetHandle()
SafeHandle.DangerousRelease()
SafeHandle.Dispose()
SafeHandle.Dispose(Boolean)
SafeHandle.SetHandle(IntPtr)
SafeHandle.SetHandleAsInvalid()
SafeHandle.IsClosed
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class RunOptions : SafeHandle, IDisposable

Constructors

| Improve this Doc View Source

RunOptions()

Default __ctor. Creates default RuntimeOptions

Declaration
public RunOptions()

Properties

| Improve this Doc View Source

IsInvalid

Overrides SafeHandle.IsInvalid

Declaration
public override bool IsInvalid { get; }
Property Value
Type Description
Boolean

returns true if handle is equal to Zero

Overrides
System.Runtime.InteropServices.SafeHandle.IsInvalid
| Improve this Doc View Source

LogId

Log tag to be used during the run. default = ""

Declaration
public string LogId { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

LogSeverityLevel

Log Severity Level for the session logs. Default = ORT_LOGGING_LEVEL_WARNING

Declaration
public OrtLoggingLevel LogSeverityLevel { get; set; }
Property Value
Type Description
OrtLoggingLevel
| Improve this Doc View Source

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.

Declaration
public int LogVerbosityLevel { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Terminate

Sets a flag to terminate all Run() calls that are currently using this RunOptions object Default = false

Declaration
public bool Terminate { get; set; }
Property Value
Type Description
Boolean

terminate flag value

Methods

| Improve this Doc View Source

AddActiveLoraAdapter(OrtLoraAdapter)

Appends the specified lora adapter to the list of active lora adapters for this RunOptions instance. All run calls with this instant will make use of the activated Lora Adapters. An adapter is considered active if it is added to RunOptions that are used during Run() calls.

Declaration
public void AddActiveLoraAdapter(OrtLoraAdapter loraAdapter)
Parameters
Type Name Description
OrtLoraAdapter loraAdapter

Lora adapter instance

| Improve this Doc View Source

AddRunConfigEntry(String, String)

Set a single run configuration entry as a pair of strings If a configuration with same key exists, this will overwrite the configuration with the given configValue.

Declaration
public void AddRunConfigEntry(string configKey, string configValue)
Parameters
Type Name Description
String configKey

config key name

String configValue

config key value

| Improve this Doc View Source

ReleaseHandle()

Overrides SafeHandle.ReleaseHandle() to properly dispose of the native instance of RunOptions

Declaration
protected override bool ReleaseHandle()
Returns
Type Description
Boolean

always returns true

Overrides
System.Runtime.InteropServices.SafeHandle.ReleaseHandle()

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top