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

Function test_bool_unary_ops

tests/python/relax/test_frontend_from_exported_program.py:158–177  ·  view source on GitHub ↗
(pytorch_op, relax_op)

Source from the content-addressed store, hash-verified

156
157@pytest.mark.parametrize("pytorch_op, relax_op", operator_bool_unary)
158def test_bool_unary_ops(pytorch_op, relax_op):
159 example_args = (torch.randn(1, 3, 10, 10, dtype=torch.float32),)
160
161 class UnaryOp(Module):
162 def forward(self, input):
163 return pytorch_op(input)
164
165 @tvm.script.ir_module
166 class expected:
167 @R.function
168 def main(input_1: R.Tensor((1, 3, 10, 10), dtype="float32")) -> R.Tuple(
169 R.Tensor((1, 3, 10, 10), dtype="bool")
170 ):
171 with R.dataflow():
172 lv: R.Tensor((1, 3, 10, 10), dtype="bool") = relax_op(input_1)
173 gv: R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")) = (lv,)
174 R.output(gv)
175 return gv
176
177 verify_model(UnaryOp(), example_args, {}, expected)
178
179
180def test_sqrt_integer_input():

Callers

nothing calls this directly

Calls 2

verify_modelFunction · 0.70
UnaryOpClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…