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

Function testArrayCopy

web/tests/node/test_tensor.js:36–46  ·  view source on GitHub ↗
(dtype, arrayType)

Source from the content-addressed store, hash-verified

34
35// Test ndarray
36function testArrayCopy(dtype, arrayType) {
37 let data = [1, 2, 3, 4, 5, 6];
38 let a = tvm.empty([2, 3], dtype).copyFrom(data);
39
40 assert(a.device.toString() == "cpu:0");
41 assert(a.shape[0] == 2 && a.shape[1] == 3);
42
43 let ret = a.toArray();
44 assert(ret instanceof arrayType);
45 assert(ret.toString() == arrayType.from(data).toString());
46}
47
48test("array copy", () => {
49 tvm.withNewScope(() => {

Callers 1

test_tensor.jsFile · 0.85

Calls 5

assertFunction · 0.85
toArrayMethod · 0.80
copyFromMethod · 0.45
emptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…