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

Method asCharArray

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

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

()

Source from the content-addressed store, hash-verified

289 * @return A copy of array content.
290 */
291 public char[] asCharArray() {
292 if (dtype.typeCode != TVMType.UINT || dtype.bits != 16) {
293 throw new IllegalArgumentException(
294 "Cannot set convert to char[] for " + dtype.toString() + " array");
295 }
296 byte[][] units = groupInternalBytes();
297 char[] array = new char[units.length];
298 for (int i = 0; i < units.length; ++i) {
299 array[i] = wrapBytes(units[i]).getChar();
300 }
301 return array;
302 }
303
304 /**
305 * Return a copied flat java array of current array (row-major).

Callers 1

test_from_uint16Method · 0.95

Calls 3

groupInternalBytesMethod · 0.95
wrapBytesMethod · 0.95
toStringMethod · 0.45

Tested by 1

test_from_uint16Method · 0.76