diff --git a/meshmode/discretization/connection/direct.py b/meshmode/discretization/connection/direct.py index 9eb0fae8a..a84b2282b 100644 --- a/meshmode/discretization/connection/direct.py +++ b/meshmode/discretization/connection/direct.py @@ -47,7 +47,13 @@ def _reshape_and_preserve_tags( actx: ArrayContext, ary: ArrayT, new_shape: Tuple[int, ...]) -> ArrayT: - return actx.tag(ary.tags, ary.reshape(new_shape)) + try: + tags = ary.tags + except AttributeError: + # 'ary' might not have a 'tags' attribute (e.g., in case of an np.ndarray) + return ary.reshape(new_shape) + else: + return actx.tag(tags, ary.reshape(new_shape)) # {{{ interpolation batch