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

Method asLongArray

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

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

()

Source from the content-addressed store, hash-verified

235 * @return A copy of array content.
236 */
237 public long[] asLongArray() {
238 if (dtype.typeCode != TVMType.INT || dtype.bits != 64) {
239 throw new IllegalArgumentException(
240 "Cannot set convert to long[] for " + dtype.toString() + " array");
241 }
242 byte[][] units = groupInternalBytes();
243 long[] array = new long[units.length];
244 for (int i = 0; i < units.length; ++i) {
245 array[i] = wrapBytes(units[i]).getLong();
246 }
247 return array;
248 }
249
250 /**
251 * Return a copied flat java array of current array (row-major).

Callers 1

test_from_int64Method · 0.95

Calls 3

groupInternalBytesMethod · 0.95
wrapBytesMethod · 0.95
toStringMethod · 0.45

Tested by 1

test_from_int64Method · 0.76