From dddd4e5f9fc7b45e03de36707ddffd60773f0d0c Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:03:17 -0500 Subject: [PATCH] hotfix: remove duplicate TestTensorMutates [pr] (#8619) * hotfix: remove duplicate TestTensorMutates [pr] * imports --- test/unit/test_rewrite_map.py | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/test/unit/test_rewrite_map.py b/test/unit/test_rewrite_map.py index 0cafb9b9ab..f0b833dd19 100644 --- a/test/unit/test_rewrite_map.py +++ b/test/unit/test_rewrite_map.py @@ -1,39 +1,6 @@ import unittest -from tinygrad import dtypes, Tensor +from tinygrad import dtypes from tinygrad.ops import UOp, symbolic, graph_rewrite_map, _substitute -from test.unit.test_tensor_uop_representation import is_pattern, realized_pattern, is_pattern_uop - -class TestTensorMutates(unittest.TestCase): - def test_mutate_add(self): - a = Tensor([1,2,3]) - b = Tensor([4,5,6]) - ret = a+b - pa = a.lazydata - pb = b.lazydata - pr = ret.lazydata - ret.schedule() - self.assertIsNot(pa, a.lazydata) - self.assertIsNot(pb, b.lazydata) - self.assertIsNot(pr, ret.lazydata) - for t in [a,b,ret]: is_pattern(t, realized_pattern) - - def test_reshape_is_same_parent(self): - a = Tensor([1,2,3]) - b = Tensor([4,5,6]) - c = a+b - d = (a+b).reshape(3,1) - d.realize() - is_pattern_uop(d.lazydata.base, realized_pattern) - is_pattern_uop(c.lazydata.base, realized_pattern) - - def test_reshape_is_same_child(self): - a = Tensor([1,2,3]) - b = Tensor([4,5,6]) - c = a+b - d = (a+b).reshape(3,1) - c.realize() - is_pattern_uop(c.lazydata.base, realized_pattern) - is_pattern_uop(d.lazydata.base, realized_pattern) class TestRewriteMap(unittest.TestCase): def test_substitute(self):