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

Function test_elementwise_binary

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

Source from the content-addressed store, hash-verified

114 ],
115)
116def test_elementwise_binary(op, input_shape=(1, 2, 8, 5)):
117 remote_obj, tracker = remote()
118
119 def create_model() -> tvm.IRModule:
120 @tvm.script.ir_module
121 class Module:
122 @R.function
123 def main(
124 i0: R.Tensor((1, 2, 8, 5), "float32"),
125 i1: R.Tensor((1, 2, 8, 5), "float32"),
126 ) -> R.Tensor((1, 2, 8, 5), "float32"):
127 with R.dataflow():
128 t0 = op(i0, i1)
129 R.output(t0)
130 return t0
131
132 return Module
133
134 mod = create_model()
135 verify(
136 remote_obj,
137 tracker,
138 mod,
139 inputs=[
140 np.random.uniform(size=input_shape).astype("float32"),
141 np.random.uniform(size=input_shape).astype("float32"),
142 ],
143 )
144
145
146def test_divide(input_shape=(1, 2, 8, 5)):

Callers

nothing calls this directly

Calls 5

remoteFunction · 0.90
uniformMethod · 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…