<liclass="toctree-l2"><aclass="reference internal"href="tutorial.html#step-1-train-a-model-using-your-favorite-framework">Step 1: Train a model using your favorite framework</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="tutorial.html#step-2-convert-or-export-the-model-into-onnx-format">Step 2: Convert or export the model into ONNX format</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="tutorial.html#step-3-load-and-run-the-model-using-onnx-runtime">Step 3: Load and run the model using ONNX Runtime</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="auto_examples/index.html">Gallery of examples</a><ul>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_pipeline.html">Draw a pipeline</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_load_and_predict.html">Load and predict with ONNX Runtime and a very simple model</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_profiling.html">Profile the execution of a simple model</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_backend.html">ONNX Runtime Backend for ONNX</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_dl_keras.html">ONNX Runtime for Keras</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_convert_pipeline_vectorizer.html">Train, convert and predict with ONNX Runtime</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_common_errors.html">Common errors with onnxruntime</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="auto_examples/plot_train_convert_predict.html">Train, convert and predict with ONNX Runtime</a></li>
<codeclass="descclassname">onnxruntime.</code><codeclass="descname">get_device</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ str<aclass="headerlink"href="#onnxruntime.get_device"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the device used to compute the prediction (CPU, MKL, …)</p>
</dd></dl>
</div>
<divclass="section"id="examples-and-datasets">
<h2><aclass="toc-backref"href="#id2">Examples and datasets</a><aclass="headerlink"href="#examples-and-datasets"title="Permalink to this headline">¶</a></h2>
<p>The package contains a few models stored in ONNX format
used in the documentation. These don’t need to be downloaded
<codeclass="descclassname">onnxruntime.datasets.</code><codeclass="descname">get_example</code><spanclass="sig-paren">(</span><em>name</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/datasets.html#get_example"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.datasets.get_example"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves the absolute file name of an example.</p>
</dd></dl>
</div>
<divclass="section"id="load-and-run-a-model">
<h2><aclass="toc-backref"href="#id3">Load and run a model</a><aclass="headerlink"href="#load-and-run-a-model"title="Permalink to this headline">¶</a></h2>
<p><em>ONNX Runtime</em> reads a model saved in ONNX format.
The main class <em>InferenceSession</em> wraps these functionalities
<emclass="property">class </em><codeclass="descclassname">onnxruntime.</code><codeclass="descname">ModelMetadata</code><aclass="headerlink"href="#onnxruntime.ModelMetadata"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">custom_metadata_map</code><aclass="headerlink"href="#onnxruntime.ModelMetadata.custom_metadata_map"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">description</code><aclass="headerlink"href="#onnxruntime.ModelMetadata.description"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">producer_name</code><aclass="headerlink"href="#onnxruntime.ModelMetadata.producer_name"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">onnxruntime.</code><codeclass="descname">InferenceSession</code><spanclass="sig-paren">(</span><em>path_or_bytes</em>, <em>sess_options=None</em>, <em>providers=[]</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">disable_fallback</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.disable_fallback"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.disable_fallback"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">enable_fallback</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.enable_fallback"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.enable_fallback"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">end_profiling</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.end_profiling"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.end_profiling"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_inputs</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_inputs"><spanclass="viewcode-link">[source]</span></a><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>
<codeclass="descname">get_modelmeta</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_modelmeta"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.get_modelmeta"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_outputs</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_outputs"><spanclass="viewcode-link">[source]</span></a><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>
<codeclass="descname">get_overridable_initializers</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_overridable_initializers"><spanclass="viewcode-link">[source]</span></a><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>
<codeclass="descname">get_providers</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_providers"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.get_providers"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_session_options</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.get_session_options"><spanclass="viewcode-link">[source]</span></a><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>
<codeclass="descname">run</code><spanclass="sig-paren">(</span><em>output_names</em>, <em>input_feed</em>, <em>run_options=None</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.run"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.run"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_providers</code><spanclass="sig-paren">(</span><em>providers</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/onnxruntime/capi/session.html#InferenceSession.set_providers"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#onnxruntime.InferenceSession.set_providers"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">onnxruntime.</code><codeclass="descname">NodeArg</code><aclass="headerlink"href="#onnxruntime.NodeArg"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">onnxruntime.</code><codeclass="descname">RunOptions</code><aclass="headerlink"href="#onnxruntime.RunOptions"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">log_severity_level</code><aclass="headerlink"href="#onnxruntime.RunOptions.log_severity_level"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">log_verbosity_level</code><aclass="headerlink"href="#onnxruntime.RunOptions.log_verbosity_level"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">onnxruntime.</code><codeclass="descname">SessionOptions</code><aclass="headerlink"href="#onnxruntime.SessionOptions"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">enable_cpu_mem_arena</code><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_cpu_mem_arena"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">enable_mem_pattern</code><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_mem_pattern"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">enable_profiling</code><aclass="headerlink"href="#onnxruntime.SessionOptions.enable_profiling"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">execution_mode</code><aclass="headerlink"href="#onnxruntime.SessionOptions.execution_mode"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">graph_optimization_level</code><aclass="headerlink"href="#onnxruntime.SessionOptions.graph_optimization_level"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">inter_op_num_threads</code><aclass="headerlink"href="#onnxruntime.SessionOptions.inter_op_num_threads"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">intra_op_num_threads</code><aclass="headerlink"href="#onnxruntime.SessionOptions.intra_op_num_threads"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">log_severity_level</code><aclass="headerlink"href="#onnxruntime.SessionOptions.log_severity_level"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">log_verbosity_level</code><aclass="headerlink"href="#onnxruntime.SessionOptions.log_verbosity_level"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">optimized_model_filepath</code><aclass="headerlink"href="#onnxruntime.SessionOptions.optimized_model_filepath"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">onnxruntime.backend.</code><codeclass="descname">is_compatible</code><spanclass="sig-paren">(</span><em>model</em>, <em>device=None</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.is_compatible"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">onnxruntime.backend.</code><codeclass="descname">prepare</code><spanclass="sig-paren">(</span><em>model</em>, <em>device=None</em>, <em>**kwargs</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>
<codeclass="descclassname">onnxruntime.backend.</code><codeclass="descname">run</code><spanclass="sig-paren">(</span><em>model</em>, <em>inputs</em>, <em>device=None</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.run"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">onnxruntime.backend.</code><codeclass="descname">supports_device</code><spanclass="sig-paren">(</span><em>device</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#onnxruntime.backend.supports_device"title="Permalink to this definition">¶</a></dt>