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

Function test_local

tests/python/contrib/test_random.py:110–122  ·  view source on GitHub ↗
(dev, dtype)

Source from the content-addressed store, hash-verified

108 """Tests random_fill function"""
109
110 def test_local(dev, dtype):
111 if not tvm.get_global_func("tvm.contrib.random.random_fill", True):
112 print("skip because extern function is not available")
113 return
114 value = tvm.runtime.empty((512, 512), dtype, dev)
115 random_fill = tvm.get_global_func("tvm.contrib.random.random_fill")
116 random_fill(value)
117
118 assert np.count_nonzero(value.numpy()) == 512 * 512
119
120 # make sure arithmentic doesn't overflow too
121 np_values = value.numpy()
122 assert np.isfinite(np_values * np_values + np_values).any()
123
124 def test_rpc(dtype):
125 if not tvm.get_global_func("tvm.contrib.random.random_fill", True):

Callers 1

test_random_fillFunction · 0.85

Calls 4

printFunction · 0.85
get_global_funcMethod · 0.80
numpyMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…