()
| 1068 | |
| 1069 | |
| 1070 | def test_logical_or(): |
| 1071 | class LogicalOr(Module): |
| 1072 | def forward(self, lhs, rhs): |
| 1073 | return torch.logical_or(lhs, rhs) |
| 1074 | |
| 1075 | @tvm.script.ir_module |
| 1076 | class expected: |
| 1077 | @R.function |
| 1078 | def main( |
| 1079 | lhs: R.Tensor((1, 3, 10, 10), dtype="float32"), |
| 1080 | rhs: R.Tensor((1, 3, 10, 10), dtype="float32"), |
| 1081 | ) -> R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")): |
| 1082 | # block 0 |
| 1083 | with R.dataflow(): |
| 1084 | lv: R.Tensor((1, 3, 10, 10), dtype="bool") = R.astype(lhs, dtype="bool") |
| 1085 | lv1: R.Tensor((1, 3, 10, 10), dtype="bool") = R.astype(rhs, dtype="bool") |
| 1086 | lv2: R.Tensor((1, 3, 10, 10), dtype="bool") = R.logical_or(lv, lv1) |
| 1087 | gv: R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")) = (lv2,) |
| 1088 | R.output(gv) |
| 1089 | return gv |
| 1090 | |
| 1091 | example_args = ( |
| 1092 | torch.randn(1, 3, 10, 10, dtype=torch.float32), |
| 1093 | torch.randn(1, 3, 10, 10, dtype=torch.float32), |
| 1094 | ) |
| 1095 | verify_model(LogicalOr(), example_args, {}, expected) |
| 1096 | |
| 1097 | |
| 1098 | def test_logical_xor(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…