little symbolic changes [pr] (#6849)

* little symbolic changes [pr]

* symbolic needs resolve too

* no resolve

* less change
This commit is contained in:
George Hotz
2024-10-02 17:12:30 +08:00
committed by GitHub
parent fc78716d31
commit 7214450c23
6 changed files with 34 additions and 21 deletions

View File

@@ -39,6 +39,10 @@ class TestUOpResolve(unittest.TestCase):
u = UOp.const(dtypes.int, 4) > 7
self.assertFalse(u)
def test_ssimplify(self):
self.assertEqual((8 % UOp.const(dtypes.int, 4)).ssimplify(), 0)
self.assertEqual((8 * UOp.const(dtypes.int, 4)).ssimplify(), 32)
def test_ambiguous_less_than(self):
u = UOp.define_var("i", dtypes.pyint, 1, 10)
self.assertTrue(resolve(u < 4))