From 22674798dff150f0f7bf1ae2ad358ff28ccfe973 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:42:22 +0300 Subject: [PATCH] assert correctness in test_permuted_assignment [pr] (#12483) --- test/test_assign.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_assign.py b/test/test_assign.py index 09c589f3fe..b517c8e39d 100644 --- a/test/test_assign.py +++ b/test/test_assign.py @@ -280,13 +280,14 @@ class TestAssign(unittest.TestCase): b.realize() ba1 = a.uop.base.realized bb1 = b.uop.base.realized - with self.assertRaises((RuntimeError, AssertionError)): + with self.assert_permuted_assign(): a = a.permute(1,0) a += b a.realize() ba2 = a.uop.base.realized - assert ba1 != ba2 and ba1 != bb1 np.testing.assert_allclose(a.numpy(), np.arange(N*N).reshape((N,N)) + np.arange(N*N).reshape((N,N)).transpose(1,0)) + # permute and base are the same buffer + assert ba1 == ba2 and ba1 != bb1 def test_post_permuted_assignment(self): a = Tensor(np.arange(N*N, dtype=np.float32)).reshape(N,N)