Skip to content

Commit ac47866

Browse files
committed
compiler: Fix nbytes_avail_map
1 parent 1c64939 commit ac47866

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

devito/operator/operator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,6 @@ def _op_symbols(self):
13461346

13471347
def _apply_override(self, i):
13481348
try:
1349-
# TODO: is _obj even needed?
13501349
return self.get(i.name, i)._obj
13511350
except AttributeError:
13521351
return self.get(i.name, i)
@@ -1357,11 +1356,12 @@ def _get_nbytes(self, i):
13571356
overrides.
13581357
"""
13591358
obj = self._apply_override(i)
1360-
1361-
if obj.is_regular:
1362-
nbytes = obj.nbytes
1363-
else:
1359+
try:
1360+
# Non-regular AbstractFunction (compressed, etc)
13641361
nbytes = obj.nbytes_max
1362+
except AttributeError:
1363+
# Garden-variety AbstractFunction
1364+
nbytes = obj.nbytes
13651365

13661366
# Could nominally have symbolic nbytes at this point
13671367
if isinstance(nbytes, SympyBasic):

0 commit comments

Comments
 (0)