File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 34
34
from dpctl .utils import SequentialOrderManager
35
35
36
36
import dpnp
37
- from dpnp .dpnp_array import dpnp_array
38
37
39
38
40
39
def dpnp_fill (arr , val ):
@@ -43,7 +42,7 @@ def dpnp_fill(arr, val):
43
42
44
43
dpnp .check_supported_arrays_type (val , scalar_type = True , all_scalars = True )
45
44
# if val is an array, process it
46
- if isinstance (val , ( dpnp_array , dpt . usm_ndarray ) ):
45
+ if dpnp . is_supported_array_type (val ):
47
46
val = dpnp .get_usm_ndarray (val )
48
47
if val .shape != ():
49
48
raise ValueError ("`val` must be a scalar" )
@@ -61,6 +60,10 @@ def dpnp_fill(arr, val):
61
60
)
62
61
_manager .add_event_pair (h_ev , c_ev )
63
62
return
63
+ elif not dpnp .isscalar (val ):
64
+ raise TypeError (
65
+ f"Expected `val` to be an array or Python scalar, got { type (val )} "
66
+ )
64
67
65
68
dt = arr .dtype
66
69
val_type = type (val )
You can’t perform that action at this time.
0 commit comments