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

Method asDoubleArray

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

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

()

Source from the content-addressed store, hash-verified

199 * @return A copy of array content.
200 */
201 public double[] asDoubleArray() {
202 if (dtype.typeCode != TVMType.FLOAT || dtype.bits != 64) {
203 throw new IllegalArgumentException(
204 "Cannot set convert to double[] for " + dtype.toString() + " array");
205 }
206 byte[][] units = groupInternalBytes();
207 double[] array = new double[units.length];
208 for (int i = 0; i < units.length; ++i) {
209 array[i] = wrapBytes(units[i]).getDouble();
210 }
211 return array;
212 }
213
214 /**
215 * Return a copied flat java array of current array (row-major).

Callers 1

test_from_float64Method · 0.95

Calls 3

groupInternalBytesMethod · 0.95
wrapBytesMethod · 0.95
toStringMethod · 0.45

Tested by 1

test_from_float64Method · 0.76