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

Method groupInternalBytes

jvm/core/src/main/java/org/apache/tvm/Tensor.java:331–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329 }
330
331 private byte[][] groupInternalBytes() {
332 byte[] raw = internal();
333 int unitSize = dtype.numOfBytes;
334 if (raw.length <= 0 || raw.length % unitSize != 0) {
335 throw new IllegalArgumentException(String.format(
336 "%s size %d cannot divide byte array size %d", dtype.toString(), unitSize, raw.length));
337 }
338
339 int numOfUnits = raw.length / unitSize;
340 byte[][] units = new byte[numOfUnits][unitSize];
341 for (int i = 0; i < numOfUnits; ++i) {
342 System.arraycopy(raw, i * unitSize, units[i], 0, unitSize);
343 }
344 return units;
345 }
346
347 /**
348 * Get the device of current array.

Callers 6

asDoubleArrayMethod · 0.95
asFloatArrayMethod · 0.95
asLongArrayMethod · 0.95
asIntArrayMethod · 0.95
asShortArrayMethod · 0.95
asCharArrayMethod · 0.95

Calls 2

internalMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected