onnxruntime/docs/api/csharp/api/Microsoft.ML.OnnxRuntime.SessionOptions.html
github-actions[bot] aef4472ef1
[Automated]: Update C# API docs (#12964)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: RandySheriffH <RandySheriffH@users.noreply.github.com>
2022-09-28 14:38:21 -07:00

1426 lines
59 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class SessionOptions
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class SessionOptions
">
<meta name="generator" content="docfx 2.59.3.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions">
<h1 id="Microsoft_ML_OnnxRuntime_SessionOptions" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions" class="text-break">Class SessionOptions
</h1>
<div class="markdown level0 summary"><p>Holds the options for creating an InferenceSession</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">SessionOptions</span></div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Microsoft.ML.OnnxRuntime.html">Microsoft.ML.OnnxRuntime</a></h6>
<h6><strong>Assembly</strong>: cs.temp.dll.dll</h6>
<h5 id="Microsoft_ML_OnnxRuntime_SessionOptions_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class SessionOptions : SafeHandle</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions__ctor_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.#ctor*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions__ctor" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.#ctor">SessionOptions()</h4>
<div class="markdown level1 summary"><p>Constructs an empty SessionOptions</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SessionOptions()</code></pre>
</div>
<h3 id="properties">Properties
</h3>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableCpuMemArena_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableCpuMemArena*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableCpuMemArena" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableCpuMemArena">EnableCpuMemArena</h4>
<div class="markdown level1 summary"><p>Enables Arena allocator for the CPU memory allocations. Default is true.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool EnableCpuMemArena { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>returns _enableCpuMemArena flag value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableMemoryPattern_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableMemoryPattern*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableMemoryPattern" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableMemoryPattern">EnableMemoryPattern</h4>
<div class="markdown level1 summary"><p>Enables the use of the memory allocation patterns in the first Run() call for subsequent runs. Default = true.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool EnableMemoryPattern { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>returns enableMemoryPattern flag value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableProfiling_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableProfiling*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_EnableProfiling" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.EnableProfiling">EnableProfiling</h4>
<div class="markdown level1 summary"><p>Enables profiling of InferenceSession.Run() calls. Default is false</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool EnableProfiling { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>returns _enableProfiling flag value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_ExecutionMode_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ExecutionMode*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_ExecutionMode" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ExecutionMode">ExecutionMode</h4>
<div class="markdown level1 summary"><p>Sets the execution mode for the session. Default is set to ORT_SEQUENTIAL.
See [ONNX_Runtime_Perf_Tuning.md] for more details.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ExecutionMode ExecutionMode { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.ExecutionMode.html">ExecutionMode</a></td>
<td><p>returns _executionMode value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_GraphOptimizationLevel_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.GraphOptimizationLevel*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_GraphOptimizationLevel" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.GraphOptimizationLevel">GraphOptimizationLevel</h4>
<div class="markdown level1 summary"><p>Sets the graph optimization level for the session. Default is set to ORT_ENABLE_ALL.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public GraphOptimizationLevel GraphOptimizationLevel { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.GraphOptimizationLevel.html">GraphOptimizationLevel</a></td>
<td><p>returns _graphOptimizationLevel value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_InterOpNumThreads_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.InterOpNumThreads*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_InterOpNumThreads" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.InterOpNumThreads">InterOpNumThreads</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int InterOpNumThreads { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_IntraOpNumThreads_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.IntraOpNumThreads*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_IntraOpNumThreads" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.IntraOpNumThreads">IntraOpNumThreads</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int IntraOpNumThreads { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_IsInvalid_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.IsInvalid*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_IsInvalid" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.IsInvalid">IsInvalid</h4>
<div class="markdown level1 summary"><p>Overrides SafeHandle.IsInvalid</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public override bool IsInvalid { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>returns true if handle is equal to Zero</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_LogId_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogId*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_LogId" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogId">LogId</h4>
<div class="markdown level1 summary"><p>Log Id to be used for the session. Default is empty string.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public string LogId { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>returns _logId value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_LogSeverityLevel_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogSeverityLevel*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_LogSeverityLevel" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogSeverityLevel">LogSeverityLevel</h4>
<div class="markdown level1 summary"><p>Log Severity Level for the session logs. Default = ORT_LOGGING_LEVEL_WARNING</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public OrtLoggingLevel LogSeverityLevel { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtLoggingLevel.html">OrtLoggingLevel</a></td>
<td><p>returns _logSeverityLevel value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_LogVerbosityLevel_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogVerbosityLevel*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_LogVerbosityLevel" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.LogVerbosityLevel">LogVerbosityLevel</h4>
<div class="markdown level1 summary"><p>Log Verbosity Level for the session logs. Default = 0. Valid values are &gt;=0.
This takes into effect only when the LogSeverityLevel is set to ORT_LOGGING_LEVEL_VERBOSE.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int LogVerbosityLevel { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><p>returns _logVerbosityLevel value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_OptimizedModelFilePath_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.OptimizedModelFilePath*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_OptimizedModelFilePath" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.OptimizedModelFilePath">OptimizedModelFilePath</h4>
<div class="markdown level1 summary"><p>Set filepath to save optimized model after graph level transformations. Default is empty, which implies saving is disabled.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public string OptimizedModelFilePath { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>returns _optimizedModelFilePath flag value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_ProfileOutputPathPrefix_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ProfileOutputPathPrefix*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_ProfileOutputPathPrefix" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ProfileOutputPathPrefix">ProfileOutputPathPrefix</h4>
<div class="markdown level1 summary"><p>Path prefix to use for output of profiling data</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public string ProfileOutputPathPrefix { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AddFreeDimensionOverride_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddFreeDimensionOverride*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AddFreeDimensionOverride_System_String_System_Int64_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddFreeDimensionOverride(System.String,System.Int64)">AddFreeDimensionOverride(String, Int64)</h4>
<div class="markdown level1 summary"><p>Override symbolic dimensions (by specific denotation strings) with actual values if known at session initialization time to enable
optimizations that can take advantage of fixed values (such as memory planning, etc)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AddFreeDimensionOverride(string dimDenotation, long dimValue)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">dimDenotation</span></td>
<td><p>denotation name</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><span class="parametername">dimValue</span></td>
<td><p>denotation value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AddFreeDimensionOverrideByName_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddFreeDimensionOverrideByName*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AddFreeDimensionOverrideByName_System_String_System_Int64_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddFreeDimensionOverrideByName(System.String,System.Int64)">AddFreeDimensionOverrideByName(String, Int64)</h4>
<div class="markdown level1 summary"><p>Override symbolic dimensions (by specific name strings) with actual values if known at session initialization time to enable
optimizations that can take advantage of fixed values (such as memory planning, etc)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AddFreeDimensionOverrideByName(string dimName, long dimValue)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">dimName</span></td>
<td><p>dimension name</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int64</span></td>
<td><span class="parametername">dimValue</span></td>
<td><p>dimension value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AddInitializer_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddInitializer*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AddInitializer_System_String_Microsoft_ML_OnnxRuntime_OrtValue_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddInitializer(System.String,Microsoft.ML.OnnxRuntime.OrtValue)">AddInitializer(String, OrtValue)</h4>
<div class="markdown level1 summary"><p>Add a pre-allocated initializer to a session. If a model contains an initializer with a name
that is same as the name passed to this API call, ORT will use this initializer instance
instead of deserializing one from the model file. This is useful when you want to share
the same initializer across sessions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AddInitializer(string name, OrtValue ortValue)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">name</span></td>
<td><p>name of the initializer</p>
</td>
</tr>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtValue.html">OrtValue</a></td>
<td><span class="parametername">ortValue</span></td>
<td><p>OrtValue containing the initializer. Lifetime of 'val' and the underlying initializer buffer must be
managed by the user (created using the CreateTensorWithDataAsOrtValue API) and it must outlive the session object</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AddSessionConfigEntry_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddSessionConfigEntry*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AddSessionConfigEntry_System_String_System_String_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AddSessionConfigEntry(System.String,System.String)">AddSessionConfigEntry(String, String)</h4>
<div class="markdown level1 summary"><p>Set a single session configuration entry as a pair of strings
If a configuration with same key exists, this will overwrite the configuration with the given configValue</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AddSessionConfigEntry(string configKey, string configValue)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">configKey</span></td>
<td><p>config key name</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">configValue</span></td>
<td><p>config key value</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_System_String_Dictionary_System_String_System_String__" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider(System.String,Dictionary{System.String,System.String})">AppendExecutionProvider(String, Dictionary&lt;String, String&gt;)</h4>
<div class="markdown level1 summary"><p>Append SNPE or XNNPACK execution provider</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider(string providerName, Dictionary&lt;string, string&gt; providerOptions = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">providerName</span></td>
<td><p>Execution provider to add. 'SNPE' or 'XNNPACK' are currently supported.</p>
</td>
</tr>
<tr>
<td><span class="xref">Dictionary</span>&lt;<span class="xref">System.String</span>, <span class="xref">System.String</span>&gt;</td>
<td><span class="parametername">providerOptions</span></td>
<td><p>Optional key/value pairs to specify execution provider options.</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CoreML_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CoreML*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CoreML_Microsoft_ML_OnnxRuntime_CoreMLFlags_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CoreML(Microsoft.ML.OnnxRuntime.CoreMLFlags)">AppendExecutionProvider_CoreML(CoreMLFlags)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_CoreML(CoreMLFlags coremlFlags = CoreMLFlags.COREML_FLAG_USE_NONE)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.CoreMLFlags.html">CoreMLFlags</a></td>
<td><span class="parametername">coremlFlags</span></td>
<td><p>CoreML specific flags</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CPU_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CPU*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CPU_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CPU(System.Int32)">AppendExecutionProvider_CPU(Int32)</h4>
<div class="markdown level1 summary"><p>Appends CPU EP to a list of available execution providers for the session.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_CPU(int useArena = 1)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">useArena</span></td>
<td><p>1 - use arena, 0 - do not use arena</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CUDA_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CUDA*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CUDA_Microsoft_ML_OnnxRuntime_OrtCUDAProviderOptions_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CUDA(Microsoft.ML.OnnxRuntime.OrtCUDAProviderOptions)">AppendExecutionProvider_CUDA(OrtCUDAProviderOptions)</h4>
<div class="markdown level1 summary"><p>Append a CUDA EP instance (based on specified configuration) to the SessionOptions instance.
Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_CUDA(OrtCUDAProviderOptions cudaProviderOptions)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtCUDAProviderOptions.html">OrtCUDAProviderOptions</a></td>
<td><span class="parametername">cudaProviderOptions</span></td>
<td><p>CUDA EP provider options</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CUDA_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CUDA*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_CUDA_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_CUDA(System.Int32)">AppendExecutionProvider_CUDA(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_CUDA(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>integer device ID</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_DML_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_DML*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_DML_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_DML(System.Int32)">AppendExecutionProvider_DML(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_DML(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>device identification</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Dnnl_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Dnnl*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Dnnl_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Dnnl(System.Int32)">AppendExecutionProvider_Dnnl(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_Dnnl(int useArena = 1)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">useArena</span></td>
<td><p>1 - use allocation arena, 0 - otherwise</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_MIGraphX_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_MIGraphX*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_MIGraphX_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_MIGraphX(System.Int32)">AppendExecutionProvider_MIGraphX(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_MIGraphX(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>device identification</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Nnapi_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Nnapi*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Nnapi_Microsoft_ML_OnnxRuntime_NnapiFlags_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Nnapi(Microsoft.ML.OnnxRuntime.NnapiFlags)">AppendExecutionProvider_Nnapi(NnapiFlags)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_Nnapi(NnapiFlags nnapiFlags = NnapiFlags.NNAPI_FLAG_USE_NONE)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.NnapiFlags.html">NnapiFlags</a></td>
<td><span class="parametername">nnapiFlags</span></td>
<td><p>NNAPI specific flag mask</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_OpenVINO_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_OpenVINO*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_OpenVINO_System_String_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_OpenVINO(System.String)">AppendExecutionProvider_OpenVINO(String)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_OpenVINO(string deviceId = &quot;&quot;)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>device identification, default empty string</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_ROCM_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_ROCM*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_ROCM_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_ROCM(System.Int32)">AppendExecutionProvider_ROCM(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_ROCM(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>Device Id</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tensorrt_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tensorrt*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tensorrt_Microsoft_ML_OnnxRuntime_OrtTensorRTProviderOptions_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tensorrt(Microsoft.ML.OnnxRuntime.OrtTensorRTProviderOptions)">AppendExecutionProvider_Tensorrt(OrtTensorRTProviderOptions)</h4>
<div class="markdown level1 summary"><p>Append a TensorRT EP instance (based on specified configuration) to the SessionOptions instance.
Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_Tensorrt(OrtTensorRTProviderOptions trtProviderOptions)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtTensorRTProviderOptions.html">OrtTensorRTProviderOptions</a></td>
<td><span class="parametername">trtProviderOptions</span></td>
<td><p>TensorRT EP provider options</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tensorrt_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tensorrt*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tensorrt_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tensorrt(System.Int32)">AppendExecutionProvider_Tensorrt(Int32)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_Tensorrt(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>device identification</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tvm_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tvm*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_AppendExecutionProvider_Tvm_System_String_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_Tvm(System.String)">AppendExecutionProvider_Tvm(String)</h4>
<div class="markdown level1 summary"><p>Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void AppendExecutionProvider_Tvm(string settings = &quot;&quot;)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">settings</span></td>
<td><p>string with TVM specific settings</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithCudaProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithCudaProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithCudaProvider_Microsoft_ML_OnnxRuntime_OrtCUDAProviderOptions_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithCudaProvider(Microsoft.ML.OnnxRuntime.OrtCUDAProviderOptions)">MakeSessionOptionWithCudaProvider(OrtCUDAProviderOptions)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for CUDA execution provider.
Use only if CUDA is installed and you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithCudaProvider(OrtCUDAProviderOptions cudaProviderOptions)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtCUDAProviderOptions.html">OrtCUDAProviderOptions</a></td>
<td><span class="parametername">cudaProviderOptions</span></td>
<td><p>CUDA EP provider options</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution on provider options</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithCudaProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithCudaProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithCudaProvider_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithCudaProvider(System.Int32)">MakeSessionOptionWithCudaProvider(Int32)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for CUDA execution.
Use only if CUDA is installed and you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithCudaProvider(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution on deviceId</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithRocmProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithRocmProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithRocmProvider_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithRocmProvider(System.Int32)">MakeSessionOptionWithRocmProvider(Int32)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for ROCM execution.
Use only if ROCM is installed and you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithRocmProvider(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td><p>Device Id</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution on deviceId</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTensorrtProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTensorrtProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTensorrtProvider_Microsoft_ML_OnnxRuntime_OrtTensorRTProviderOptions_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTensorrtProvider(Microsoft.ML.OnnxRuntime.OrtTensorRTProviderOptions)">MakeSessionOptionWithTensorrtProvider(OrtTensorRTProviderOptions)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for TensorRT execution provider.
Use only if CUDA/TensorRT are installed and you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithTensorrtProvider(OrtTensorRTProviderOptions trtProviderOptions)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.OrtTensorRTProviderOptions.html">OrtTensorRTProviderOptions</a></td>
<td><span class="parametername">trtProviderOptions</span></td>
<td><p>TensorRT EP provider options</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution on provider options</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTensorrtProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTensorrtProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTensorrtProvider_System_Int32_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTensorrtProvider(System.Int32)">MakeSessionOptionWithTensorrtProvider(Int32)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for TensorRT execution.
Use only if CUDA/TensorRT are installed and you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithTensorrtProvider(int deviceId = 0)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">deviceId</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution on deviceId</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTvmProvider_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTvmProvider*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_MakeSessionOptionWithTvmProvider_String_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.MakeSessionOptionWithTvmProvider(String)">MakeSessionOptionWithTvmProvider(String)</h4>
<div class="markdown level1 summary"><p>A helper method to construct a SessionOptions object for TVM execution.
Use only if you have the onnxruntime package specific to this Execution Provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static SessionOptions MakeSessionOptionWithTvmProvider(String settings = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">String</span></td>
<td><span class="parametername">settings</span></td>
<td><p>settings string, comprises of comma separated key:value pairs. default is empty</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.SessionOptions.html">SessionOptions</a></td>
<td><p>A SessionsOptions() object configured for execution with TVM</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_RegisterCustomOpLibrary_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.RegisterCustomOpLibrary*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_RegisterCustomOpLibrary_System_String_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.RegisterCustomOpLibrary(System.String)">RegisterCustomOpLibrary(String)</h4>
<div class="markdown level1 summary"><p>(Deprecated) Loads a DLL named 'libraryPath' and looks for this entry point:
OrtStatus* RegisterCustomOps(OrtSessionOptions* options, const OrtApiBase* api);
It then passes in the provided session options to this function along with the api base.
Deprecated in favor of RegisterCustomOpLibraryV2() because it provides users with the library handle
to release when all sessions relying on it are destroyed</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCustomOpLibrary(string libraryPath)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">libraryPath</span></td>
<td><p>path to the custom op library</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_RegisterCustomOpLibraryV2_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.RegisterCustomOpLibraryV2*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_RegisterCustomOpLibraryV2_System_String_IntPtr__" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.RegisterCustomOpLibraryV2(System.String,IntPtr@)">RegisterCustomOpLibraryV2(String, out IntPtr)</h4>
<div class="markdown level1 summary"><p>Loads a DLL named 'libraryPath' and looks for this entry point:
OrtStatus* RegisterCustomOps(OrtSessionOptions* options, const OrtApiBase* api);
It then passes in the provided session options to this function along with the api base.
The handle to the loaded library is returned in 'libraryHandle'.
It can be unloaded by the caller after all sessions using the passed in
session options are destroyed, or if an error occurs and it is non null.
Hint: .NET Core 3.1 has a 'NativeLibrary' class that can be used to free the library handle</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RegisterCustomOpLibraryV2(string libraryPath, out IntPtr libraryHandle)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">libraryPath</span></td>
<td><p>Custom op library path</p>
</td>
</tr>
<tr>
<td><span class="xref">IntPtr</span></td>
<td><span class="parametername">libraryHandle</span></td>
<td><p>out parameter, library handle</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_SessionOptions_ReleaseHandle_" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ReleaseHandle*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_SessionOptions_ReleaseHandle" data-uid="Microsoft.ML.OnnxRuntime.SessionOptions.ReleaseHandle">ReleaseHandle()</h4>
<div class="markdown level1 summary"><p>Overrides SafeHandle.ReleaseHandle() to properly dispose of
the native instance of SessionOptions</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">protected override bool ReleaseHandle()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>always returns true</p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>