Skip to content

Commit 4ba7186

Browse files
committed
Use dpnp.bool in dpnp_fill and make isinstance check more efficient
1 parent 865867a commit 4ba7186

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dpnp/dpnp_algo/dpnp_fill.py

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

2929
import dpctl.tensor as dpt
3030
import dpctl.utils as dpu
31-
import numpy as np
3231
from dpctl.tensor._ctors import _cast_fill_val
3332
from dpctl.tensor._tensor_impl import (
3433
_copy_usm_ndarray_into_usm_ndarray,
@@ -61,7 +60,7 @@ def dpnp_fill(arr, val):
6160
)
6261
_manager.add_event_pair(h_ev, c_ev)
6362
return
64-
elif not isinstance(val, Number) and not isinstance(val, np.bool_):
63+
elif not isinstance(val, (Number, dpnp.bool)):
6564
raise TypeError(
6665
f"array cannot be filled with `val` of type {type(val)}"
6766
)

0 commit comments

Comments
 (0)