MCPcopy Index your code
hub / github.com/apache/tvm / asIntArray

Method asIntArray

jvm/core/src/main/java/org/apache/tvm/Tensor.java:255–266  ·  view source on GitHub ↗

Return a copied flat java array of current array (row-major). The Tensor dtype must be int32 @return A copy of array content.

()

Source from the content-addressed store, hash-verified

253 * @return A copy of array content.
254 */
255 public int[] asIntArray() {
256 if (dtype.typeCode != TVMType.INT || dtype.bits != 32) {
257 throw new IllegalArgumentException(
258 "Cannot set convert to int[] for " + dtype.toString() + " array");
259 }
260 byte[][] units = groupInternalBytes();
261 int[] array = new int[units.length];
262 for (int i = 0; i < units.length; ++i) {
263 array[i] = wrapBytes(units[i]).getInt();
264 }
265 return array;
266 }
267
268 /**
269 * Return a copied flat java array of current array (row-major).

Callers 1

test_from_int32Method · 0.95

Calls 3

groupInternalBytesMethod · 0.95
wrapBytesMethod · 0.95
toStringMethod · 0.45

Tested by 1

test_from_int32Method · 0.76