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

Function test_logical_and

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

Source from the content-addressed store, hash-verified

1017
1018
1019def 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
1047def test_logical_not():

Callers

nothing calls this directly

Calls 2

verify_modelFunction · 0.70
LogicalAndClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…