<h2><aclass="toc-backref"href="#id1"role="doc-backlink">API Overview</a><aclass="headerlink"href="#api-overview"title="Permalink to this heading">¶</a></h2>
<h3><aclass="toc-backref"href="#id2"role="doc-backlink">Load and run a model</a><aclass="headerlink"href="#load-and-run-a-model"title="Permalink to this heading">¶</a></h3>
<p>The list of available execution providers can be found here: <aclass="reference external"href="https://onnxruntime.ai/docs/execution-providers">Execution Providers</a>.</p>
<p>Since ONNX Runtime 1.10, you must explicitly specify the execution provider for your target.
Running on CPU is the only time the API allows no explicit setting of the <cite>provider</cite> parameter.
In the examples that follow, the <cite>CUDAExecutionProvider</cite> and <cite>CPUExecutionProvider</cite> are used, assuming the application is running on NVIDIA GPUs.
Replace these with the execution provider specific to your environment.</p>
<p>You can supply other session configurations via the <cite>session options</cite> parameter. For example, to enable
<h3><aclass="toc-backref"href="#id3"role="doc-backlink">Data inputs and outputs</a><aclass="headerlink"href="#data-inputs-and-outputs"title="Permalink to this heading">¶</a></h3>
<h4><aclass="toc-backref"href="#id4"role="doc-backlink">Data on CPU</a><aclass="headerlink"href="#data-on-cpu"title="Permalink to this heading">¶</a></h4>
<spanclass="n">ortvalue</span><spanclass="o">.</span><spanclass="n">shape</span><spanclass="p">()</span><spanclass="c1"># shape of the numpy array X</span>
<h4><aclass="toc-backref"href="#id5"role="doc-backlink">Data on device</a><aclass="headerlink"href="#data-on-device"title="Permalink to this heading">¶</a></h4>
<spanclass="n">Y_ortvalue</span><spanclass="o">=</span><spanclass="n">onnxruntime</span><spanclass="o">.</span><spanclass="n">OrtValue</span><spanclass="o">.</span><spanclass="n">ortvalue_from_shape_and_type</span><spanclass="p">([</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">],</span><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">float32</span><spanclass="p">,</span><spanclass="s1">'cuda'</span><spanclass="p">,</span><spanclass="mi">0</span><spanclass="p">)</span><spanclass="c1"># Change the shape to the actual shape of the output being bound</span>
<p>In addition, <em>ONNX Runtime</em> supports directly working with <em>OrtValue</em> (s) while inferencing a model if provided as part of the input feed.</p>
<spanclass="n">Y_ortvalue</span><spanclass="o">=</span><spanclass="n">onnxruntime</span><spanclass="o">.</span><spanclass="n">OrtValue</span><spanclass="o">.</span><spanclass="n">ortvalue_from_shape_and_type</span><spanclass="p">([</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">],</span><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">float32</span><spanclass="p">,</span><spanclass="s1">'cuda'</span><spanclass="p">,</span><spanclass="mi">0</span><spanclass="p">)</span><spanclass="c1"># Change the shape to the actual shape of the output being bound</span>
<spanclass="c1">## Allocate the PyTorch tensor for the model output</span>
<spanclass="n">Y_shape</span><spanclass="o">=</span><spanclass="o">...</span><spanclass="c1"># You need to specify the output PyTorch tensor shape</span>
<h2><aclass="toc-backref"href="#id6"role="doc-backlink">API Details</a><aclass="headerlink"href="#api-details"title="Permalink to this heading">¶</a></h2>
<h3><aclass="toc-backref"href="#id7"role="doc-backlink">InferenceSession</a><aclass="headerlink"href="#inferencesession"title="Permalink to this heading">¶</a></h3>
<spanclass="sig-name descname"><spanclass="pre">disable_fallback</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.disable_fallback"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">enable_fallback</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.enable_fallback"title="Permalink to this definition">¶</a></dt>
<dd><p>Enable session.Run() fallback mechanism. If session.Run() fails due to an internal Execution Provider failure,
reset the Execution Providers enabled for this session.
If GPU is enabled, fall back to CUDAExecutionProvider.
<spanclass="sig-name descname"><spanclass="pre">end_profiling</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.end_profiling"title="Permalink to this definition">¶</a></dt>
<dd><p>End profiling and return results in a file.</p>
<p>The results are stored in a filename if the option
<spanclass="sig-name descname"><spanclass="pre">get_inputs</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_inputs"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the inputs metadata as a list of <aclass="reference internal"href="#onnxruntime.NodeArg"title="onnxruntime.NodeArg"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.NodeArg</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_modelmeta</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_modelmeta"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the metadata. See <aclass="reference internal"href="#onnxruntime.ModelMetadata"title="onnxruntime.ModelMetadata"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.ModelMetadata</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_outputs</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_outputs"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the outputs metadata as a list of <aclass="reference internal"href="#onnxruntime.NodeArg"title="onnxruntime.NodeArg"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.NodeArg</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_overridable_initializers</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_overridable_initializers"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the inputs (including initializers) metadata as a list of <aclass="reference internal"href="#onnxruntime.NodeArg"title="onnxruntime.NodeArg"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.NodeArg</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_profiling_start_time_ns</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_profiling_start_time_ns"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the nanoseconds of profiling’s start time
Comparable to time.monotonic_ns() after Python 3.3
On some platforms, this timer may not be as precise as nanoseconds
For instance, on Windows and MacOS, the precision will be ~100ns</p>
<spanclass="sig-name descname"><spanclass="pre">get_provider_options</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_provider_options"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_providers</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_providers"title="Permalink to this definition">¶</a></dt>
<dd><p>Return list of registered execution providers.</p>
<spanclass="sig-name descname"><spanclass="pre">get_session_options</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.get_session_options"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the session options. See <aclass="reference internal"href="#onnxruntime.SessionOptions"title="onnxruntime.SessionOptions"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.SessionOptions</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">io_binding</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.io_binding"title="Permalink to this definition">¶</a></dt>
<dd><p>Return an onnxruntime.IOBinding object`.</p>
<spanclass="sig-name descname"><spanclass="pre">run</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">output_names</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">input_feed</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">run_options</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.run"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">run_with_iobinding</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">iobinding</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">run_options</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.run_with_iobinding"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">run_with_ort_values</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">output_names</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">input_dict_ort_values</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">run_options</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.run_with_ort_values"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">run_with_ortvaluevector</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">run_options</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">feed_names</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">feeds</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">fetch_names</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">fetches</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">fetch_devices</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.run_with_ortvaluevector"title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the predictions similar to other run_*() methods but with minimal C++/Python conversion overhead.</p>
<spanclass="sig-name descname"><spanclass="pre">set_providers</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">providers</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">provider_options</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.InferenceSession.set_providers"title="Permalink to this definition">¶</a></dt>
<dd><p>Register the input list of execution providers. The underlying session is re-created.</p>
<h4><aclass="toc-backref"href="#id9"role="doc-backlink">RunOptions</a><aclass="headerlink"href="#runoptions"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">RunOptions</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">self</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#onnxruntime.RunOptions"title="onnxruntime.capi.onnxruntime_pybind11_state.RunOptions"><spanclass="pre">onnxruntime.capi.onnxruntime_pybind11_state.RunOptions</span></a></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.RunOptions"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">log_severity_level</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.log_severity_level"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">log_verbosity_level</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.log_verbosity_level"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">logid</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.logid"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">only_execute_path_to_fetches</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.only_execute_path_to_fetches"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">synchronize_execution_providers</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.synchronize_execution_providers"title="Permalink to this definition">¶</a></dt>
<dd><p>Synchronize execution providers after executing session.</p>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">terminate</span></span><aclass="headerlink"href="#onnxruntime.RunOptions.terminate"title="Permalink to this definition">¶</a></dt>
<h4><aclass="toc-backref"href="#id10"role="doc-backlink">SessionOptions</a><aclass="headerlink"href="#sessionoptions"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">SessionOptions</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">self</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#onnxruntime.SessionOptions"title="onnxruntime.capi.onnxruntime_pybind11_state.SessionOptions"><spanclass="pre">onnxruntime.capi.onnxruntime_pybind11_state.SessionOptions</span></a></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.SessionOptions"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">enable_cpu_mem_arena</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_cpu_mem_arena"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">enable_mem_pattern</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_mem_pattern"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">enable_mem_reuse</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_mem_reuse"title="Permalink to this definition">¶</a></dt>
<dd><p>Enable the memory reuse optimization. Default is true.</p>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">enable_profiling</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_profiling"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">execution_mode</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.execution_mode"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">execution_order</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.execution_order"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">graph_optimization_level</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.graph_optimization_level"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">inter_op_num_threads</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.inter_op_num_threads"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">intra_op_num_threads</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.intra_op_num_threads"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">log_severity_level</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.log_severity_level"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">log_verbosity_level</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.log_verbosity_level"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">logid</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.logid"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">optimized_model_filepath</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.optimized_model_filepath"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">profile_file_prefix</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.profile_file_prefix"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">use_deterministic_compute</span></span><aclass="headerlink"href="#onnxruntime.SessionOptions.use_deterministic_compute"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">OrtValue</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">ortvalue</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">numpy_obj</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue"title="Permalink to this definition">¶</a></dt>
<dd><p>A data structure that supports all ONNX data formats (tensors and non-tensors) that allows users
to place the data backing these on a device, for example, on a CUDA supported device.
This class provides APIs to construct and deal with OrtValues.</p>
<spanclass="sig-name descname"><spanclass="pre">as_sparse_tensor</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.as_sparse_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.as_sparse_tensor"title="Permalink to this definition">¶</a></dt>
<dd><p>The function will return SparseTensor contained in this OrtValue</p>
<spanclass="sig-name descname"><spanclass="pre">data_ptr</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.data_ptr"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.data_ptr"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the address of the first element in the OrtValue’s data buffer</p>
<spanclass="sig-name descname"><spanclass="pre">data_type</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.data_type"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.data_type"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the data type of the data in the OrtValue</p>
<spanclass="sig-name descname"><spanclass="pre">device_name</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.device_name"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.device_name"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the name of the device where the OrtValue’s data buffer resides e.g. cpu, cuda</p>
<spanclass="sig-name descname"><spanclass="pre">element_type</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.element_type"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.element_type"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the proto type of the data in the OrtValue
<spanclass="sig-name descname"><spanclass="pre">has_value</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.has_value"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.has_value"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the OrtValue corresponding to an
optional type contains data, else returns False</p>
<spanclass="sig-name descname"><spanclass="pre">is_sparse_tensor</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.is_sparse_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.is_sparse_tensor"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the OrtValue contains a SparseTensor, else returns False</p>
<spanclass="sig-name descname"><spanclass="pre">is_tensor</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.is_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.is_tensor"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the OrtValue contains a Tensor, else returns False</p>
<spanclass="sig-name descname"><spanclass="pre">is_tensor_sequence</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.is_tensor_sequence"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.is_tensor_sequence"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the OrtValue contains a Tensor Sequence, else returns False</p>
<spanclass="sig-name descname"><spanclass="pre">numpy</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.numpy"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.numpy"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a Numpy object from the OrtValue.
Valid only for OrtValues holding Tensors. Throws for OrtValues holding non-Tensors.
Use accessors to gain a reference to non-Tensor objects such as SparseTensor</p>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">ort_value_from_sparse_tensor</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">sparse_tensor</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.ort_value_from_sparse_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.ort_value_from_sparse_tensor"title="Permalink to this definition">¶</a></dt>
<dd><p>The function will construct an OrtValue instance from a valid SparseTensor
The new instance of OrtValue will assume the ownership of sparse_tensor</p>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">ortvalue_from_numpy</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">numpy_obj</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device_type</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'cpu'</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device_id</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.ortvalue_from_numpy"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.ortvalue_from_numpy"title="Permalink to this definition">¶</a></dt>
<dd><p>Factory method to construct an OrtValue (which holds a Tensor) from a given Numpy object
A copy of the data in the Numpy object is held by the OrtValue only if the device is NOT cpu</p>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">ortvalue_from_shape_and_type</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">shape</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">element_type</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device_type</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'cpu'</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device_id</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.ortvalue_from_shape_and_type"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.ortvalue_from_shape_and_type"title="Permalink to this definition">¶</a></dt>
<dd><p>Factory method to construct an OrtValue (which holds a Tensor) from given shape and element_type</p>
<spanclass="sig-name descname"><spanclass="pre">shape</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.shape"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.shape"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the shape of the data in the OrtValue</p>
<spanclass="sig-name descname"><spanclass="pre">update_inplace</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">np_arr</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtValue.update_inplace"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtValue.update_inplace"title="Permalink to this definition">¶</a></dt>
<dd><p>Update the OrtValue in place with a new Numpy array. The numpy contents
are copied over to the device memory backing the OrtValue. It can be used
to update the input valuess for an InferenceSession with CUDA graph
enabled or other scenarios where the OrtValue needs to be updated while
<h4><aclass="toc-backref"href="#id13"role="doc-backlink">SparseTensor</a><aclass="headerlink"href="#sparsetensor"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">SparseTensor</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">sparse_tensor</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor"title="Permalink to this definition">¶</a></dt>
<dd><p>A data structure that project the C++ SparseTensor object
The class provides API to work with the object.
Depending on the format, the class will hold more than one buffer
<spanclass="sig-name descname"><spanclass="pre">as_blocksparse_view</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.as_blocksparse_view"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.as_blocksparse_view"title="Permalink to this definition">¶</a></dt>
<dd><p>The method will return coo representation of the sparse tensor which will enable
querying BlockSparse indices. If the instance did not contain BlockSparse format, it would throw.
<spanclass="sig-name descname"><spanclass="pre">as_coo_view</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.as_coo_view"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.as_coo_view"title="Permalink to this definition">¶</a></dt>
<dd><p>The method will return coo representation of the sparse tensor which will enable
querying COO indices. If the instance did not contain COO format, it would throw.
<spanclass="sig-name descname"><spanclass="pre">as_csrc_view</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.as_csrc_view"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.as_csrc_view"title="Permalink to this definition">¶</a></dt>
<dd><p>The method will return CSR(C) representation of the sparse tensor which will enable
querying CRS(C) indices. If the instance dit not contain CSR(C) format, it would throw.
<spanclass="sig-name descname"><spanclass="pre">data_type</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.data_type"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.data_type"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a string data type of the data in the OrtValue</p>
<spanclass="sig-name descname"><spanclass="pre">dense_shape</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.dense_shape"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.dense_shape"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a numpy array(int64) containing a dense shape of a sparse tensor</p>
<spanclass="sig-name descname"><spanclass="pre">device_name</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.device_name"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.device_name"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the name of the device where the SparseTensor data buffers reside e.g. cpu, cuda</p>
<spanclass="sig-name descname"><spanclass="pre">format</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.format"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.format"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">sparse_coo_from_numpy</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">dense_shape</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">values</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">coo_indices</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ort_device</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.sparse_coo_from_numpy"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.sparse_coo_from_numpy"title="Permalink to this definition">¶</a></dt>
<dd><p>Factory method to construct a SparseTensor in COO format from given arguments</p>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">sparse_csr_from_numpy</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">dense_shape</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">values</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">inner_indices</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">outer_indices</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ort_device</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.sparse_csr_from_numpy"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.sparse_csr_from_numpy"title="Permalink to this definition">¶</a></dt>
<dd><p>Factory method to construct a SparseTensor in CSR format from given arguments</p>
<spanclass="sig-name descname"><spanclass="pre">to_cuda</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">ort_device</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.to_cuda"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.to_cuda"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a copy of this instance on the specified cuda device</p>
<spanclass="sig-name descname"><spanclass="pre">values</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#SparseTensor.values"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.SparseTensor.values"title="Permalink to this definition">¶</a></dt>
<dd><p>The method returns a numpy array that is backed by the native memory
if the data type is numeric. Otherwise, the returned numpy array that contains
<h4><aclass="toc-backref"href="#id15"role="doc-backlink">IOBinding</a><aclass="headerlink"href="#iobinding"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">IOBinding</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">session</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding"title="Permalink to this definition">¶</a></dt>
<dd><p>This class provides API to bind input/output to a specified device, e.g. GPU.</p>
<spanclass="sig-name descname"><spanclass="pre">bind_cpu_input</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">arr_on_cpu</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding.bind_cpu_input"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding.bind_cpu_input"title="Permalink to this definition">¶</a></dt>
<dd><p>bind an input to array on CPU
:param name: input name
:param arr_on_cpu: input values as a python array on CPU</p>
<spanclass="sig-name descname"><spanclass="pre">bind_ortvalue_input</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ortvalue</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding.bind_ortvalue_input"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding.bind_ortvalue_input"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">bind_ortvalue_output</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ortvalue</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding.bind_ortvalue_output"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding.bind_ortvalue_output"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">copy_outputs_to_cpu</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding.copy_outputs_to_cpu"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding.copy_outputs_to_cpu"title="Permalink to this definition">¶</a></dt>
<dd><p>Copy output contents to CPU (if on another device). No-op if already on the CPU.</p>
<spanclass="sig-name descname"><spanclass="pre">get_outputs</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#IOBinding.get_outputs"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.IOBinding.get_outputs"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the output OrtValues from the Run() that preceded the call.
The data buffer of the obtained OrtValues may not reside on CPU memory</p>
<h4><aclass="toc-backref"href="#id16"role="doc-backlink">OrtDevice</a><aclass="headerlink"href="#ortdevice"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">OrtDevice</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">c_ort_device</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="modules/onnxruntime/capi/onnxruntime_inference_collection.html#OrtDevice"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#onnxruntime.OrtDevice"title="Permalink to this definition">¶</a></dt>
<dd><p>A data structure that exposes the underlying C++ OrtDevice</p>
<h3><aclass="toc-backref"href="#id17"role="doc-backlink">Internal classes</a><aclass="headerlink"href="#internal-classes"title="Permalink to this heading">¶</a></h3>
<h4><aclass="toc-backref"href="#id18"role="doc-backlink">ModelMetadata</a><aclass="headerlink"href="#modelmetadata"title="Permalink to this heading">¶</a></h4>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">ModelMetadata</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata"title="Permalink to this definition">¶</a></dt>
<dd><p>Pre-defined and custom metadata about the model.
It is usually used to identify the model used to run the prediction and
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">custom_metadata_map</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.custom_metadata_map"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">description</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.description"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">domain</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.domain"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">graph_description</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.graph_description"title="Permalink to this definition">¶</a></dt>
<dd><p>description of the graph hosted in the model</p>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">graph_name</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.graph_name"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">producer_name</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.producer_name"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">version</span></span><aclass="headerlink"href="#onnxruntime.ModelMetadata.version"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.</span></span><spanclass="sig-name descname"><spanclass="pre">NodeArg</span></span><aclass="headerlink"href="#onnxruntime.NodeArg"title="Permalink to this definition">¶</a></dt>
<dd><p>Node argument definition, for both input and output,
including arg name, arg type (contains both type and shape).</p>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">name</span></span><aclass="headerlink"href="#onnxruntime.NodeArg.name"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">shape</span></span><aclass="headerlink"href="#onnxruntime.NodeArg.shape"title="Permalink to this definition">¶</a></dt>
<dd><p>node shape (assuming the node holds a tensor)</p>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">type</span></span><aclass="headerlink"href="#onnxruntime.NodeArg.type"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.backend.</span></span><spanclass="sig-name descname"><spanclass="pre">is_compatible</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">model</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.is_compatible"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.backend.</span></span><spanclass="sig-name descname"><spanclass="pre">prepare</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">model</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.prepare"title="Permalink to this definition">¶</a></dt>
<dd><p>Load the model and creates a <aclass="reference internal"href="#onnxruntime.InferenceSession"title="onnxruntime.InferenceSession"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">onnxruntime.InferenceSession</span></code></a>
<spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.backend.</span></span><spanclass="sig-name descname"><spanclass="pre">run</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">model</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">inputs</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.run"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">onnxruntime.backend.</span></span><spanclass="sig-name descname"><spanclass="pre">supports_device</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.supports_device"title="Permalink to this definition">¶</a></dt>