Skip to content

Commit 001520e

Browse files
committed
Add to permit NumPy bools as dpnp_fill scalar fill values
1 parent bd30f85 commit 001520e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dpnp/dpnp_algo/dpnp_fill.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import dpctl.tensor as dpt
3030
import dpctl.utils as dpu
31+
import numpy as np
3132
from dpctl.tensor._ctors import _cast_fill_val
3233
from dpctl.tensor._tensor_impl import (
3334
_copy_usm_ndarray_into_usm_ndarray,
@@ -60,7 +61,7 @@ def dpnp_fill(arr, val):
6061
)
6162
_manager.add_event_pair(h_ev, c_ev)
6263
return
63-
elif not isinstance(val, Number):
64+
elif not isinstance(val, Number) and not isinstance(val, np.bool_):
6465
raise TypeError(
6566
f"Array cannot be filled with `val` of type {type(val)}"
6667
)

0 commit comments

Comments
 (0)