fix parse_valid for float uop (#8681)

x < c -> X <= c-1 only works for int
This commit is contained in:
chenyu
2025-01-19 18:15:49 -05:00
committed by GitHub
parent 168c16646a
commit 2d0842386d
2 changed files with 3 additions and 1 deletions

View File

@@ -662,6 +662,8 @@ class TestOps(unittest.TestCase):
ten0, ten1 = Tensor(data[0], dtype=dtypes.bool), Tensor(data[1], dtype=dtypes.bool)
helper_test_op([], lambda: tor0&tor1, lambda: ten0&ten1, forward_only=True)
helper_test_op(None, lambda x: (1 < x) & (x < 2), forward_only=True, vals=[[1.2, 1.2, 1.2, 3.2]])
self.helper_test_exception([(4), (4)], torch.bitwise_and, Tensor.bitwise_and, expected=RuntimeError)
def test_or(self):