onnxruntime/docs/api/java/ai/onnxruntime/OrtUtil.html
github-actions[bot] 89eb6eb488
[Automated]: Update Java API docs (#14426)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: fs-eire <fs-eire@users.noreply.github.com>
2023-01-26 15:42:09 -08:00

809 lines
30 KiB
HTML

<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>OrtUtil (onnxruntime 1.15.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.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery-ui.overrides.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.6.0.min.js"></script>
<script type="text/javascript" src="../../jquery/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="OrtUtil (onnxruntime 1.15.0 API)";
}
}
catch(err) {
}
//-->
var data = {"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,"i19":9,"i20":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";
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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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&nbsp;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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">ai.onnxruntime</a></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>
<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 =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#elementCount(long%5B%5D)">elementCount</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#flattenString(java.lang.Object)">flattenString</a></span>&#8203;(java.lang.Object&nbsp;o)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newBooleanArray(long%5B%5D)">newBooleanArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newByteArray(long%5B%5D)">newByteArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newDoubleArray(long%5B%5D)">newDoubleArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newFloatArray(long%5B%5D)">newFloatArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newIntArray(long%5B%5D)">newIntArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newLongArray(long%5B%5D)">newLongArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newShortArray(long%5B%5D)">newShortArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newStringArray(long%5B%5D)">newStringArray</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<div class="block">Creates a new String array of up to 8 dimensions, using the supplied shape.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(boolean%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(boolean[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i11" class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(byte%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(byte[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i12" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(double%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(double[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i13" class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(float%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(float[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i14" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(int%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(int[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i15" class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(long%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(long[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i16" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(short%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(short[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<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="i17" class="rowColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reshape(java.lang.String%5B%5D,long%5B%5D)">reshape</a></span>&#8203;(java.lang.String[]&nbsp;input,
long[]&nbsp;shape)</code></th>
<td class="colLast">
<div class="block">Reshapes a String array into the desired n-dimensional array assuming the String array is
stored in n-dimensional row-major order.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static long[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#transformShape(int%5B%5D)">transformShape</a></span>&#8203;(int[]&nbsp;shape)</code></th>
<td class="colLast">
<div class="block">Converts an int shape into a long shape.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static int[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#transformShape(long%5B%5D)">transformShape</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<div class="block">Converts an long shape into a int shape.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#validateShape(long%5B%5D)">validateShape</a></span>&#8203;(long[]&nbsp;shape)</code></th>
<td class="colLast">
<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 id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="transformShape(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformShape</h4>
<pre class="methodSignature">public static&nbsp;int[]&nbsp;transformShape&#8203;(long[]&nbsp;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 id="transformShape(int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformShape</h4>
<pre class="methodSignature">public static&nbsp;long[]&nbsp;transformShape&#8203;(int[]&nbsp;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 id="newBooleanArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newBooleanArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newBooleanArray&#8203;(long[]&nbsp;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 id="newByteArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newByteArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newByteArray&#8203;(long[]&nbsp;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 id="newShortArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newShortArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newShortArray&#8203;(long[]&nbsp;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 id="newIntArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newIntArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newIntArray&#8203;(long[]&nbsp;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 id="newLongArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newLongArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newLongArray&#8203;(long[]&nbsp;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 id="newFloatArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newFloatArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newFloatArray&#8203;(long[]&nbsp;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 id="newDoubleArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newDoubleArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newDoubleArray&#8203;(long[]&nbsp;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 id="newStringArray(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newStringArray</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;newStringArray&#8203;(long[]&nbsp;shape)</pre>
<div class="block">Creates a new String 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 id="reshape(boolean[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(boolean[]&nbsp;input,
long[]&nbsp;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 id="reshape(byte[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(byte[]&nbsp;input,
long[]&nbsp;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 id="reshape(short[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(short[]&nbsp;input,
long[]&nbsp;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 id="reshape(int[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(int[]&nbsp;input,
long[]&nbsp;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 id="reshape(long[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(long[]&nbsp;input,
long[]&nbsp;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 id="reshape(float[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(float[]&nbsp;input,
long[]&nbsp;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 id="reshape(double[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(double[]&nbsp;input,
long[]&nbsp;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 id="reshape(java.lang.String[],long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reshape</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Object&nbsp;reshape&#8203;(java.lang.String[]&nbsp;input,
long[]&nbsp;shape)</pre>
<div class="block">Reshapes a String array into the desired n-dimensional array assuming the String 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 String array.</dd>
</dl>
</li>
</ul>
<a id="elementCount(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>elementCount</h4>
<pre class="methodSignature">public static&nbsp;long&nbsp;elementCount&#8203;(long[]&nbsp;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.</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 id="validateShape(long[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateShape</h4>
<pre class="methodSignature">public static&nbsp;boolean&nbsp;validateShape&#8203;(long[]&nbsp;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 id="flattenString(java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>flattenString</h4>
<pre class="methodSignature">public static&nbsp;java.lang.String[]&nbsp;flattenString&#8203;(java.lang.Object&nbsp;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>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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&nbsp;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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>