Skip to content

Commit

Permalink
Add to permit NumPy bools as dpnp_fill scalar fill values
Browse files Browse the repository at this point in the history
  • Loading branch information
ndgrigorian committed Oct 24, 2024
1 parent bd30f85 commit 865867a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dpnp/dpnp_algo/dpnp_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import dpctl.tensor as dpt
import dpctl.utils as dpu
import numpy as np
from dpctl.tensor._ctors import _cast_fill_val
from dpctl.tensor._tensor_impl import (
_copy_usm_ndarray_into_usm_ndarray,
Expand Down Expand Up @@ -60,9 +61,9 @@ def dpnp_fill(arr, val):
)
_manager.add_event_pair(h_ev, c_ev)
return
elif not isinstance(val, Number):
elif not isinstance(val, Number) and not isinstance(val, np.bool_):
raise TypeError(
f"Array cannot be filled with `val` of type {type(val)}"
f"array cannot be filled with `val` of type {type(val)}"
)

dt = arr.dtype
Expand Down

0 comments on commit 865867a

Please sign in to comment.