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

Function test_logical_not

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

Source from the content-addressed store, hash-verified

1045
1046
1047def test_logical_not():
1048 class LogicalNot(Module):
1049 def forward(self, input):
1050 return torch.logical_not(input)
1051
1052 @tvm.script.ir_module
1053 class expected:
1054 @R.function
1055 def main(input: R.Tensor((1, 3, 10, 10), dtype="float32")) -> R.Tuple(
1056 R.Tensor((1, 3, 10, 10), dtype="bool")
1057 ):
1058 # block 0
1059 with R.dataflow():
1060 lv: R.Tensor((1, 3, 10, 10), dtype="bool") = R.astype(input, dtype="bool")
1061 lv1: R.Tensor((1, 3, 10, 10), dtype="bool") = R.logical_not(lv)
1062 gv: R.Tuple(R.Tensor((1, 3, 10, 10), dtype="bool")) = (lv1,)
1063 R.output(gv)
1064 return gv
1065
1066 example_args = (torch.randn(1, 3, 10, 10, dtype=torch.float32),)
1067 verify_model(LogicalNot(), example_args, {}, expected)
1068
1069
1070def test_logical_or():

Callers

nothing calls this directly

Calls 2

verify_modelFunction · 0.70
LogicalNotClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…