From 9c520644879feae65143add32fdd97c0c4d7e1a5 Mon Sep 17 00:00:00 2001 From: Pratyai Mazumder Date: Mon, 21 Oct 2024 14:17:37 +0200 Subject: [PATCH] At least make sure that `indices` is a falsy value. Cannot just assert it for `None` because of places like: https://github.com/spcl/dace/blob/master/dace/transformation/interstate/sdfg_nesting.py#L1081 --- dace/subsets.py | 2 +- tests/python_frontend/nested_name_accesses_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dace/subsets.py b/dace/subsets.py index 831666cc28..82cc9e8797 100644 --- a/dace/subsets.py +++ b/dace/subsets.py @@ -953,7 +953,7 @@ def offset_by(self, off: Collection, negative: bool): return Indices([self.indices[i] + mult * off for i, off in enumerate(off)]) def offset_new(self, other, negative, indices=None): - assert indices is None + assert not indices if not isinstance(other, Subset): if isinstance(other, (list, tuple)): other = Indices(other) diff --git a/tests/python_frontend/nested_name_accesses_test.py b/tests/python_frontend/nested_name_accesses_test.py index 1e5b18b840..5db6152f78 100644 --- a/tests/python_frontend/nested_name_accesses_test.py +++ b/tests/python_frontend/nested_name_accesses_test.py @@ -216,7 +216,7 @@ def test_access_to_nested_transient_dappy(): KLON = 4 NBLOCKS = 5 - @dc.program + @dc.program(auto_optimize=False) def small_wip_dappy(inp: dc.float64[KLEV+1, KLON, NBLOCKS], out: dc.float64[KLEV, KLON, NBLOCKS]): for jn in dc.map[0:NBLOCKS]: tmp = np.zeros([KLEV+1, KLON])