MCPcopy Create free account
hub / github.com/apache/tvm / test_divide

Function test_divide

tests/python/nightly/test_nnapi/test_ops.py:146–173  ·  view source on GitHub ↗
(input_shape=(1, 2, 8, 5))

Source from the content-addressed store, hash-verified

144
145
146def test_divide(input_shape=(1, 2, 8, 5)):
147 remote_obj, tracker = remote()
148
149 def create_model(input_shape) -> tvm.IRModule:
150 @tvm.script.ir_module
151 class Module:
152 @R.function
153 def main(
154 i0: R.Tensor((1, 2, 8, 5), "float32"),
155 i1: R.Tensor((1, 2, 8, 5), "float32"),
156 ) -> R.Tensor((1, 2, 8, 5), "float32"):
157 with R.dataflow():
158 t0 = R.divide(i0, i1)
159 R.output(t0)
160 return t0
161
162 return Module
163
164 mod = create_model(input_shape)
165 verify(
166 remote_obj,
167 tracker,
168 mod,
169 inputs=[
170 np.random.uniform(size=input_shape).astype("float32"),
171 np.random.uniform(size=input_shape).astype("float32") + np.ones(input_shape, "float32"),
172 ],
173 )
174
175
176def test_matmul():

Callers

nothing calls this directly

Calls 6

remoteFunction · 0.90
uniformMethod · 0.80
onesMethod · 0.80
create_modelFunction · 0.70
verifyFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…