Skip to content

Commit

Permalink
PyOpenCLFakeNumpyNamespace.where: accept np.bool_
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener authored and inducer committed May 3, 2024
1 parent 2eff251 commit 146c598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arraycontext/impl/pyopencl/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 146c598

Please sign in to comment.