mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
don't allow MLB assigns with different axes (#3483)
* allow LB <- MLB assign, but don't reuse buffer * update test * update test * assign assert axes are the same
This commit is contained in:
@@ -355,6 +355,15 @@ class TestMultiTensor(unittest.TestCase):
|
||||
np.testing.assert_allclose(t0.numpy().flatten(), t1.numpy().flatten())
|
||||
assert t1.lazydata.axis == 2
|
||||
|
||||
def test_mlb_assign_change_axis(self):
|
||||
devices = (d0, d1)
|
||||
|
||||
t_none = Tensor.zeros((16, 16)).shard(devices).contiguous().realize()
|
||||
t_zero = Tensor.ones((16, 16)).shard(devices, axis=0)
|
||||
with self.assertRaises(AssertionError):
|
||||
# don't allow assigns that change axes
|
||||
t_none.assign(t_zero)
|
||||
|
||||
@unittest.skipIf(CI and Device.DEFAULT in {"GPU", "CUDA", "METAL"}, "no GPU CI")
|
||||
class TestShrinkMultiTensorShardedAxis(unittest.TestCase):
|
||||
# shrink a multitensor on sharded axis
|
||||
|
||||
Reference in New Issue
Block a user