()
| 1017 | |
| 1018 | |
| 1019 | def test_logical_and(): |
| 1020 | class LogicalAnd(Module): |
| 1021 | def forward(self, lhs, rhs): |
| 1022 | return torch.logical_and(lhs, rhs) |
| 1023 | |
| 1024 | @tvm.script.ir_module |
| 1025 | class expected: |
| 1026 | @R.function |
| 1027 | def main( |
| 1028 | lhs: R.Tensor((1, 3, 10, 10), dtype="float32"), |
| 1029 | rhs: R.Tensor((1, 3, 10, 10), dtype="float32"), |
| 1030 | ) -> R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")): |
| 1031 | # block 0 |
| 1032 | with R.dataflow(): |
| 1033 | lv: R.Tensor((1, 3, 10, 10), dtype="bool") = R.astype(lhs, dtype="bool") |
| 1034 | lv1: R.Tensor((1, 3, 10, 10), dtype="bool") = R.astype(rhs, dtype="bool") |
| 1035 | lv2: R.Tensor((1, 3, 10, 10), dtype="bool") = R.logical_and(lv, lv1) |
| 1036 | gv: R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")) = (lv2,) |
| 1037 | R.output(gv) |
| 1038 | return gv |
| 1039 | |
| 1040 | example_args = ( |
| 1041 | torch.randn(1, 3, 10, 10, dtype=torch.float32), |
| 1042 | torch.randn(1, 3, 10, 10, dtype=torch.float32), |
| 1043 | ) |
| 1044 | verify_model(LogicalAnd(), example_args, {}, expected) |
| 1045 | |
| 1046 | |
| 1047 | def test_logical_not(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…