mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
use tags instead of graph_rewrite_map in rangeify (#12110)
* use tags instead of graph_rewrite_map in rangeify * new style, add realize * metadata works * simple failure * fix * loops * stuff becomes a NOOP when you remove it * stuff becomes a NOOP when you remove it * tags on bufferize * bmnist works * locals don't work * shippable * fix some tests * simpler map_realize * remove const hack * debuggable test * broke * assign test * straight up bug * wooo it passes * sink shouldn't be there * fix ops * bmnist * kv cache ish * Set RANGEIFY context variable to 0 * should work normal * better * types * hacks to fix test_symbolic * pm_add_buffers * tests should pass
This commit is contained in:
@@ -3,6 +3,19 @@ from tinygrad import Tensor, nn
|
||||
from tinygrad.helpers import RANGEIFY, Context, GlobalCounters
|
||||
from tinygrad.uop.ops import UOp
|
||||
|
||||
@unittest.skipIf(RANGEIFY<1, "tests only for RANGEIFY")
|
||||
class TestRangeifyAssign(unittest.TestCase):
|
||||
def test_assign_permuted(self):
|
||||
A = Tensor.empty(4, 4, dtype='int')
|
||||
B = Tensor.arange(16).reshape(4,4)
|
||||
ret = A.permute(1,0).assign(B)
|
||||
lst = ret.tolist()
|
||||
lst2 = A.tolist()
|
||||
lst3 = B.tolist()
|
||||
print(lst)
|
||||
print(lst2)
|
||||
print(lst3)
|
||||
|
||||
N = 256
|
||||
|
||||
@unittest.skipIf(RANGEIFY<1, "tests only for RANGEIFY")
|
||||
|
||||
Reference in New Issue
Block a user