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

Function check

web/tests/python/webgpu_rpc_test.py:66–78  ·  view source on GitHub ↗
(remote, size)

Source from the content-addressed store, hash-verified

64 )
65
66 def check(remote, size):
67 # basic function checks.
68 dev = remote.webgpu(0)
69 adata = np.random.uniform(size=size).astype(A.dtype)
70 a = tvm.runtime.tensor(adata, dev)
71 b = tvm.runtime.tensor(np.zeros(size, dtype=A.dtype), dev)
72
73 np.testing.assert_equal(a.numpy(), adata)
74 f1 = remote.system_lib()
75 addone = f1.get_function("main")
76 addone(a, b)
77 tvm.testing.assert_allclose(b.numpy(), np.log(np.abs(a.numpy()) + 1), atol=1e-5, rtol=1e-5)
78 print("Test pass..")
79
80 check(remote, 71821 * 32)
81

Callers 1

test_rpcFunction · 0.70

Calls 10

addoneFunction · 0.85
printFunction · 0.85
uniformMethod · 0.80
numpyMethod · 0.80
system_libMethod · 0.80
webgpuMethod · 0.45
astypeMethod · 0.45
zerosMethod · 0.45
get_functionMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…