Revert "s/UPat/Pat (#7506)" [pr] (#7517)

* Revert "s/UPat/Pat (#7506)"

This reverts commit 400011a8c1.

* fix
This commit is contained in:
chenyu
2024-11-03 16:33:02 -05:00
committed by GitHub
parent e641bbc859
commit 7758f7211b
12 changed files with 347 additions and 347 deletions

View File

@@ -2,7 +2,7 @@ import unittest, pickle, types
import numpy as np
from tinygrad import Tensor, TinyJit, Variable, dtypes
from tinygrad.engine.schedule import create_schedule
from tinygrad.ops import PatternMatcher, Pat, UOp
from tinygrad.ops import PatternMatcher, UPat, UOp
class TestPickle(unittest.TestCase):
def test_pickle_code_object(self):
@@ -12,7 +12,7 @@ class TestPickle(unittest.TestCase):
self.assertEqual(fxn(2), 4)
def test_pickle_pattern_matcher(self):
pm = PatternMatcher([(Pat.cvar('x'), lambda x: x*2)])
pm = PatternMatcher([(UPat.cvar('x'), lambda x: x*2)])
sink = UOp.const(dtypes.int, 2)
tt = pm.rewrite(sink)
pm_str = pickle.dumps(pm)