(pytorch_op, relax_op)
| 156 | |
| 157 | @pytest.mark.parametrize("pytorch_op, relax_op", operator_bool_unary) |
| 158 | def 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 | |
| 180 | def test_sqrt_integer_input(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…