mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
fix assign (#3878)
* fix assign * remove terrible optimizer hack * oops, not realized assigns
This commit is contained in:
@@ -100,13 +100,12 @@ class TestAssign(unittest.TestCase):
|
||||
new = a + times_a
|
||||
np.testing.assert_allclose(new.numpy(), 5)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_assign_diamond_possible(self):
|
||||
a = Tensor.ones(4).contiguous().realize()
|
||||
times_a = a*3
|
||||
a.assign(Tensor.full((4,), 2.).contiguous())
|
||||
new = a + (times_a+1).contiguous()
|
||||
np.testing.assert_allclose(new.numpy(), 6)
|
||||
new = a + (times_a-1).contiguous()
|
||||
np.testing.assert_allclose(new.numpy(), 4)
|
||||
|
||||
def test_assign_diamond_alt(self):
|
||||
a = Tensor.ones(4).contiguous().realize()
|
||||
|
||||
Reference in New Issue
Block a user