mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-15 18:23:41 +00:00
* initial setup and rename "how to" to "setup" * move API to main nav * move api to main nav * add get starated, rework nav order * rename to install move mds out of install section * update api nav and home page * add install docs and python qs updates * python get started work * remove c and obj c for now * move java, python, and obj-c docs under api folder * move java api html to iframe (ugh) * remove api docs w/o details, move api text getstar * remove api docs wo detail updates get started * remvoe iframes * move eco system to main nav * fix api buttons * added more examples moved intro to ORT * fix links * fix get started titles * fix get started titles * fix more links * fix more links * more link fixes * fix nav remove inferencing and training subnav * fix top nav remove inference and training nav * fix title * fix tutorials nav hierarchy * fix python api button * add tenorflow keras example * fix quickstart toc * add imports fix spacing * fix links * update nav and python get started page * move ort training example, add coming soon for iot * update C# get started * fix spacing on quantization * Add some js get started content * fix formatting * fix typo * removed onnx-pytorch and onnx-tf * updated pip install torch and added links iot page * added pytorch tutorial heirarchy * updated web to docs soon added release blog link * add web link
687 lines
27 KiB
HTML
687 lines
27 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (1.8.0_221) on Fri Dec 06 15:15:32 EST 2019 -->
|
|
<title>OrtUtil (OnnxRuntime-Java-API)</title>
|
|
<meta name="date" content="2019-12-06">
|
|
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
|
|
<script type="text/javascript" src="../../script.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="OrtUtil (OnnxRuntime-Java-API)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9};
|
|
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
|
|
var altColor = "altColor";
|
|
var rowColor = "rowColor";
|
|
var tableTab = "tableTab";
|
|
var activeTableTab = "activeTableTab";
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar.top">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a name="navbar.top.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../ai/onnxruntime/package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/OrtUtil.html">Use</a></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">
|
|
<li><a href="../../ai/onnxruntime/OrtSession.SessionOptions.OptLevel.html" title="enum in ai.onnxruntime"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../ai/onnxruntime/SequenceInfo.html" title="class in ai.onnxruntime"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../index.html?ai/onnxruntime/OrtUtil.html" target="_top">Frames</a></li>
|
|
<li><a href="OrtUtil.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../allclasses-noframe.html">All Classes</a></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>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">ai.onnxruntime</div>
|
|
<h2 title="Class OrtUtil" class="title">Class OrtUtil</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>ai.onnxruntime.OrtUtil</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public final class <span class="typeNameLabel">OrtUtil</span>
|
|
extends java.lang.Object</pre>
|
|
<div class="block">Util code for interacting with Java arrays.</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr id="i0" class="altColor">
|
|
<td class="colFirst"><code>static long</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#elementCount-long:A-">elementCount</a></span>(long[] shape)</code>
|
|
<div class="block">Counts the number of elements stored in a Tensor of this shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.String[]</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#flattenString-java.lang.Object-">flattenString</a></span>(java.lang.Object o)</code>
|
|
<div class="block">Flatten a multidimensional String array into a single dimensional String array, reading
|
|
it in a multidimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newBooleanArray-long:A-">newBooleanArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive boolean array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newByteArray-long:A-">newByteArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive byte array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newDoubleArray-long:A-">newDoubleArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive double array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newFloatArray-long:A-">newFloatArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive float array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newIntArray-long:A-">newIntArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive int array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newLongArray-long:A-">newLongArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive long array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#newShortArray-long:A-">newShortArray</a></span>(long[] shape)</code>
|
|
<div class="block">Creates a new primitive short array of up to 8 dimensions, using the supplied shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-boolean:A-long:A-">reshape</a></span>(boolean[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a boolean array into the desired n-dimensional array assuming the boolean array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-byte:A-long:A-">reshape</a></span>(byte[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a byte array into the desired n-dimensional array assuming the byte array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-double:A-long:A-">reshape</a></span>(double[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a double array into the desired n-dimensional array assuming the double array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-float:A-long:A-">reshape</a></span>(float[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a float array into the desired n-dimensional array assuming the float array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-int:A-long:A-">reshape</a></span>(int[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes an int array into the desired n-dimensional array, assuming the int array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-long:A-long:A-">reshape</a></span>(long[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a long array into the desired n-dimensional array, assuming the long array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i15" class="rowColor">
|
|
<td class="colFirst"><code>static java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#reshape-short:A-long:A-">reshape</a></span>(short[] input,
|
|
long[] shape)</code>
|
|
<div class="block">Reshapes a short array into the desired n-dimensional array assuming the short array is stored in n-dimensional row-major order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>static long[]</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#transformShape-int:A-">transformShape</a></span>(int[] shape)</code>
|
|
<div class="block">Converts an int shape into a long shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>static int[]</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#transformShape-long:A-">transformShape</a></span>(long[] shape)</code>
|
|
<div class="block">Converts an long shape into a int shape.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<td class="colFirst"><code>static boolean</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../ai/onnxruntime/OrtUtil.html#validateShape-long:A-">validateShape</a></span>(long[] shape)</code>
|
|
<div class="block">Checks that the shape is a valid shape for a Java array (i.e.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="transformShape-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>transformShape</h4>
|
|
<pre>public static int[] transformShape(long[] shape)</pre>
|
|
<div class="block">Converts an long shape into a int shape.
|
|
<p>
|
|
Validates that the shape has more than 1 elements,
|
|
less than 9 elements, each element is less than <code>Integer.MAX_VALUE</code>
|
|
and that each entry is non-negative.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The long shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The int shape.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="transformShape-int:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>transformShape</h4>
|
|
<pre>public static long[] transformShape(int[] shape)</pre>
|
|
<div class="block">Converts an int shape into a long shape.
|
|
<p>
|
|
Validates that the shape has more than 1 element, less than 9 elements and that each entry is non-negative.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The int shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The long shape.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newBooleanArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newBooleanArray</h4>
|
|
<pre>public static java.lang.Object newBooleanArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive boolean array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A boolean array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newByteArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newByteArray</h4>
|
|
<pre>public static java.lang.Object newByteArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive byte array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A byte array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newShortArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newShortArray</h4>
|
|
<pre>public static java.lang.Object newShortArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive short array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A short array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newIntArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newIntArray</h4>
|
|
<pre>public static java.lang.Object newIntArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive int array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A int array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newLongArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newLongArray</h4>
|
|
<pre>public static java.lang.Object newLongArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive long array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A long array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newFloatArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newFloatArray</h4>
|
|
<pre>public static java.lang.Object newFloatArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive float array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A float array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="newDoubleArray-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>newDoubleArray</h4>
|
|
<pre>public static java.lang.Object newDoubleArray(long[] shape)</pre>
|
|
<div class="block">Creates a new primitive double array of up to 8 dimensions, using the supplied shape.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape of array to create.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A double array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-boolean:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(boolean[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a boolean array into the desired n-dimensional array assuming the boolean array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The boolean array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional boolean array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-byte:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(byte[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a byte array into the desired n-dimensional array assuming the byte array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The byte array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional byte array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-short:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(short[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a short array into the desired n-dimensional array assuming the short array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The short array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional short array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-int:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(int[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes an int array into the desired n-dimensional array, assuming the int array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The int array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional int array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-long:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(long[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a long array into the desired n-dimensional array, assuming the long array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The long array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional long array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-float:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(float[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a float array into the desired n-dimensional array assuming the float array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The float array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional float array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="reshape-double:A-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reshape</h4>
|
|
<pre>public static java.lang.Object reshape(double[] input,
|
|
long[] shape)</pre>
|
|
<div class="block">Reshapes a double array into the desired n-dimensional array assuming the double array is stored in n-dimensional row-major order.
|
|
Throws <code>IllegalArgumentException</code> if the number of elements doesn't match between the shape and the input or the shape is invalid.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>input</code> - The double array.</dd>
|
|
<dd><code>shape</code> - The desired shape.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An n-dimensional double array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="elementCount-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>elementCount</h4>
|
|
<pre>public static long elementCount(long[] shape)</pre>
|
|
<div class="block">Counts the number of elements stored in a Tensor of this shape.
|
|
<p>
|
|
Multiplies all the elements together if they are positive, throws an <code>IllegalArgumentException</code> otherwise.
|
|
</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape to use.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The number of elements.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="validateShape-long:A-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>validateShape</h4>
|
|
<pre>public static boolean validateShape(long[] shape)</pre>
|
|
<div class="block">Checks that the shape is a valid shape for a Java array (i.e. that the values are all positive and representable by an int).</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>shape</code> - The shape to check.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>True if the shape is valid.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="flattenString-java.lang.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>flattenString</h4>
|
|
<pre>public static java.lang.String[] flattenString(java.lang.Object o)</pre>
|
|
<div class="block">Flatten a multidimensional String array into a single dimensional String array, reading
|
|
it in a multidimensional row-major order.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>o</code> - A multidimensional String array.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>A single dimensional String array.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar.bottom">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a name="navbar.bottom.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../ai/onnxruntime/package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/OrtUtil.html">Use</a></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">
|
|
<li><a href="../../ai/onnxruntime/OrtSession.SessionOptions.OptLevel.html" title="enum in ai.onnxruntime"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../ai/onnxruntime/SequenceInfo.html" title="class in ai.onnxruntime"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../index.html?ai/onnxruntime/OrtUtil.html" target="_top">Frames</a></li>
|
|
<li><a href="OrtUtil.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../allclasses-noframe.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>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</body>
|
|
</html>
|