From e2eb5aface9f45fd79cc3d1974dedd981e8f0dfc Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Fri, 3 May 2024 11:10:45 -0500 Subject: [PATCH] PyOpenCLFakeNumpyNamespace.where: accept np.bool_ --- arraycontext/impl/pyopencl/fake_numpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arraycontext/impl/pyopencl/fake_numpy.py b/arraycontext/impl/pyopencl/fake_numpy.py index 6044e0c9..c6276657 100644 --- a/arraycontext/impl/pyopencl/fake_numpy.py +++ b/arraycontext/impl/pyopencl/fake_numpy.py @@ -354,7 +354,7 @@ def absolute(self, a): def where(self, criterion, then, else_): def where_inner(inner_crit, inner_then, inner_else): - if isinstance(inner_crit, bool): + if isinstance(inner_crit, (bool, np.bool_)): return inner_then if inner_crit else inner_else return cl_array.if_positive(inner_crit != 0, inner_then, inner_else, queue=self._array_context.queue)