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

Function test_logical_or

tests/python/relax/test_frontend_from_exported_program.py:1070–1095  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1068
1069
1070def 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
1098def test_logical_xor():

Callers

nothing calls this directly

Calls 2

verify_modelFunction · 0.70
LogicalOrClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…