mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-14 18:12:05 +00:00
408 lines
16 KiB
HTML
408 lines
16 KiB
HTML
<!DOCTYPE HTML>
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc -->
|
|
<title>ai.onnxruntime (onnxruntime 1.13.0 API)</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">
|
|
<script type="text/javascript" src="../../script.js"></script>
|
|
<script type="text/javascript" src="../../jquery/jszip/dist/jszip.min.js"></script>
|
|
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
|
|
<!--[if IE]>
|
|
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
|
|
<![endif]-->
|
|
<script type="text/javascript" src="../../jquery/jquery-3.5.1.js"></script>
|
|
<script type="text/javascript" src="../../jquery/jquery-ui.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="ai.onnxruntime (onnxruntime 1.13.0 API)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var pathtoroot = "../../";
|
|
var useModuleDirectories = true;
|
|
loadScripts(document, 'script');</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<header role="banner">
|
|
<nav role="navigation">
|
|
<div class="fixedNav">
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a id="navbar.top">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.top.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../index.html">Overview</a></li>
|
|
<li class="navBarCell1Rev">Package</li>
|
|
<li>Class</li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../index-all.html">Index</a></li>
|
|
<li><a href="../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../allclasses.html">All Classes</a></li>
|
|
</ul>
|
|
<ul class="navListSearch">
|
|
<li><label for="search">SEARCH:</label>
|
|
<input type="text" id="search" value="search" disabled="disabled">
|
|
<input type="reset" id="reset" value="reset" disabled="disabled">
|
|
</li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</div>
|
|
<a id="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
</div>
|
|
<div class="navPadding"> </div>
|
|
<script type="text/javascript"><!--
|
|
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
|
//-->
|
|
</script>
|
|
</nav>
|
|
</header>
|
|
<main role="main">
|
|
<div class="header">
|
|
<h1 title="Package" class="title">Package ai.onnxruntime</h1>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<section role="region"><a id="package.description">
|
|
<!-- -->
|
|
</a>
|
|
<div class="block">A Java interface to the ONNX Runtime.
|
|
|
|
<p>Provides access to the same execution backends as the C library. Non-representable types in
|
|
Java (such as fp16) are converted into the nearest Java primitive type when accessed through this
|
|
API.
|
|
|
|
<p>There are two shared libraries required: <code>onnxruntime</code> and <code>onnxruntime4j_jni
|
|
</code>. The loader is in <code>OnnxRuntime</code> and the logic is in this order:
|
|
|
|
<ol>
|
|
<li>The user may signal to skip loading of a shared library using a property in the form <code>
|
|
onnxruntime.native.LIB_NAME.skip</code> with a value of <code>true</code>. This means the
|
|
user has decided to load the library by some other means.
|
|
<li>The user may specify an explicit location of all native library files using a property in
|
|
the form <code>onnxruntime.native.path</code>. This uses <code>System.load(java.lang.String)</code>.
|
|
<li>The user may specify an explicit location of the shared library file using a property in
|
|
the form <code>onnxruntime.native.LIB_NAME.path</code>. This uses <code>System.load(java.lang.String)</code>.
|
|
<li>The shared library is autodiscovered:
|
|
<ol>
|
|
<li>If the shared library is present in the classpath resources, load using <code>System.load(java.lang.String)</code> via a temporary file. Ideally, this should be the default use
|
|
case when adding JAR's/dependencies containing the shared libraries to your
|
|
classpath.
|
|
<li>If the shared library is not present in the classpath resources, then load using
|
|
<code>System.loadLibrary(java.lang.String)</code>, which usually looks elsewhere on the filesystem
|
|
for the library. The semantics and behavior of that method are system/JVM dependent.
|
|
Typically, the <code>java.library.path</code> property is used to specify the
|
|
location of native libraries.
|
|
</ol>
|
|
</ol>
|
|
|
|
For troubleshooting, all shared library loading events are reported to Java logging at the level
|
|
FINE.
|
|
|
|
<p>Note that CUDA, ROCM, DNNL, OpenVINO and TensorRT are all "shared library execution providers"
|
|
and must be stored either in the directory containing the ONNX Runtime core native library, or as
|
|
a classpath resource. This is because these providers are loaded by the ONNX Runtime native
|
|
library itself and the Java API cannot control the loading location.</div>
|
|
</section>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<table class="typeSummary">
|
|
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Interface</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tbody>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxValue.html" title="interface in ai.onnxruntime">OnnxValue</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Top interface for input and output values from ONNX models.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtProviderOptions.OrtProviderSupplier.html" title="interface in ai.onnxruntime">OrtProviderOptions.OrtProviderSupplier</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Functional interface mirroring a Java supplier, but can throw OrtException.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="ValueInfo.html" title="interface in ai.onnxruntime">ValueInfo</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Interface for info objects describing an <a href="OnnxValue.html" title="interface in ai.onnxruntime"><code>OnnxValue</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
<li class="blockList">
|
|
<table class="typeSummary">
|
|
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Class</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tbody>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="MapInfo.html" title="class in ai.onnxruntime">MapInfo</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Describes an <a href="OnnxMap.html" title="class in ai.onnxruntime"><code>OnnxMap</code></a> object or output node.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="NodeInfo.html" title="class in ai.onnxruntime">NodeInfo</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The info for an input or output node from an ONNX model.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxMap.html" title="class in ai.onnxruntime">OnnxMap</a></th>
|
|
<td class="colLast">
|
|
<div class="block">A container for a map returned by <a href="OrtSession.html#run(java.util.Map)"><code>OrtSession.run(Map)</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxModelMetadata.html" title="class in ai.onnxruntime">OnnxModelMetadata</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Contains the metadata associated with an ONNX model.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxSequence.html" title="class in ai.onnxruntime">OnnxSequence</a></th>
|
|
<td class="colLast">
|
|
<div class="block">A sequence of <a href="OnnxValue.html" title="interface in ai.onnxruntime"><code>OnnxValue</code></a>s all of the same type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxTensor.html" title="class in ai.onnxruntime">OnnxTensor</a></th>
|
|
<td class="colLast">
|
|
<div class="block">A Java object wrapping an OnnxTensor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtEnvironment.html" title="class in ai.onnxruntime">OrtEnvironment</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The host object for the onnx-runtime system.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtEnvironment.ThreadingOptions.html" title="class in ai.onnxruntime">OrtEnvironment.ThreadingOptions</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Controls the global thread pools in the environment.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtProviderOptions.html" title="class in ai.onnxruntime">OrtProviderOptions</a></th>
|
|
<td class="colLast">
|
|
<div class="block">An abstract base class for execution provider options classes.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.html" title="class in ai.onnxruntime">OrtSession</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Wraps an ONNX model and allows inference calls.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.Result.html" title="class in ai.onnxruntime">OrtSession.Result</a></th>
|
|
<td class="colLast">
|
|
<div class="block">An <code>AutoCloseable</code> wrapper around a <code>Map</code> containing <a href="OnnxValue.html" title="interface in ai.onnxruntime"><code>OnnxValue</code></a>s.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.RunOptions.html" title="class in ai.onnxruntime">OrtSession.RunOptions</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Used to control logging and termination of a call to <a href="OrtSession.html#run(java.util.Map)"><code>OrtSession.run(java.util.Map<java.lang.String, ai.onnxruntime.OnnxTensor>)</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.SessionOptions.html" title="class in ai.onnxruntime">OrtSession.SessionOptions</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Represents the options used to construct this session.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtUtil.html" title="class in ai.onnxruntime">OrtUtil</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Util code for interacting with Java arrays.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="SequenceInfo.html" title="class in ai.onnxruntime">SequenceInfo</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Describes an <a href="OnnxSequence.html" title="class in ai.onnxruntime"><code>OnnxSequence</code></a>, including it's element type if known.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="TensorInfo.html" title="class in ai.onnxruntime">TensorInfo</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Describes an <a href="OnnxTensor.html" title="class in ai.onnxruntime"><code>OnnxTensor</code></a>, including it's size, shape and element type.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
<li class="blockList">
|
|
<table class="typeSummary">
|
|
<caption><span>Enum Summary</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Enum</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tbody>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxJavaType.html" title="enum in ai.onnxruntime">OnnxJavaType</a></th>
|
|
<td class="colLast">
|
|
<div class="block">An enum representing onnxruntime supported Java primitive types (and String).</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxMap.OnnxMapValueType.html" title="enum in ai.onnxruntime">OnnxMap.OnnxMapValueType</a></th>
|
|
<td class="colLast">
|
|
<div class="block">An enum representing the Java type of the values stored in an <a href="OnnxMap.html" title="class in ai.onnxruntime"><code>OnnxMap</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OnnxValue.OnnxValueType.html" title="enum in ai.onnxruntime">OnnxValue.OnnxValueType</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The type of the <a href="OnnxValue.html" title="interface in ai.onnxruntime"><code>OnnxValue</code></a>, mirroring the id in the C API.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtException.OrtErrorCode.html" title="enum in ai.onnxruntime">OrtException.OrtErrorCode</a></th>
|
|
<td class="colLast">
|
|
<div class="block">Maps the OrtErrorCode struct in "onnxruntime_c_api.h" with an additional entry for Java side
|
|
errors.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtLoggingLevel.html" title="enum in ai.onnxruntime">OrtLoggingLevel</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The logging level for messages from the environment and session.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtProvider.html" title="enum in ai.onnxruntime">OrtProvider</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The execution providers available through the Java API.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.SessionOptions.ExecutionMode.html" title="enum in ai.onnxruntime">OrtSession.SessionOptions.ExecutionMode</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The execution mode to use.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colFirst" scope="row"><a href="OrtSession.SessionOptions.OptLevel.html" title="enum in ai.onnxruntime">OrtSession.SessionOptions.OptLevel</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The optimisation level to use.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="TensorInfo.OnnxTensorType.html" title="enum in ai.onnxruntime">TensorInfo.OnnxTensorType</a></th>
|
|
<td class="colLast">
|
|
<div class="block">The native element types supported by the ONNX runtime.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
<li class="blockList">
|
|
<table class="typeSummary">
|
|
<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Exception</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tbody>
|
|
<tr class="altColor">
|
|
<th class="colFirst" scope="row"><a href="OrtException.html" title="class in ai.onnxruntime">OrtException</a></th>
|
|
<td class="colLast">
|
|
<div class="block">An exception which contains the error message and code produced by the native onnxruntime.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</main>
|
|
<footer role="contentinfo">
|
|
<nav role="navigation">
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a id="navbar.bottom">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.bottom.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../index.html">Overview</a></li>
|
|
<li class="navBarCell1Rev">Package</li>
|
|
<li>Class</li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../index-all.html">Index</a></li>
|
|
<li><a href="../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../allclasses.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</div>
|
|
<a id="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</nav>
|
|
</footer>
|
|
</body>
|
|
</html>
|