From d147e2a54972af7fc5bfaa378029a09fe67bf3f4 Mon Sep 17 00:00:00 2001 From: chenyu Date: Thu, 16 Apr 2026 09:59:26 -0400 Subject: [PATCH] update test_nested_after_contiguous_store (#15763) add kernel counts and some TODOs --- test/unit/test_assign.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/test_assign.py b/test/unit/test_assign.py index 3671f583d4..309357868a 100644 --- a/test/unit/test_assign.py +++ b/test/unit/test_assign.py @@ -633,10 +633,12 @@ class TestAssign(unittest.TestCase): def test_nested_after_contiguous_store(self): # Mirrors the nested contiguous-write-then-assign-back shape from torch backend view updates. base = Tensor.empty(3, dtype=dtypes.int64) - base.assign(Tensor([1, 2, 3], dtype=dtypes.int64)) + base.assign(Tensor([1, 2, 3], dtype=dtypes.int64)) # TODO: cycle error if commented this line out contig = base.contiguous() contig.assign(Tensor([1, 4, 3], dtype=dtypes.int64)) + GlobalCounters.reset() base.assign(contig).realize() + self.assertEqual(GlobalCounters.kernel_count, 3) # TODO: first copy is not required self.assertEqual(base.tolist(), [1,4,3]) class TestAssignOrdering(unittest.TestCase):