File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 24
24
# THE POSSIBILITY OF SUCH DAMAGE.
25
25
# *****************************************************************************
26
26
27
- from numbers import Number
28
-
29
27
import dpctl .tensor as dpt
30
28
import dpctl .utils as dpu
31
- import numpy as np
32
- from dpctl .tensor ._ctors import _cast_fill_val
29
+ from dpctl .tensor ._ctors import _cast_fill_val , _validate_fill_value
33
30
from dpctl .tensor ._tensor_impl import (
34
31
_copy_usm_ndarray_into_usm_ndarray ,
35
32
_full_usm_ndarray ,
@@ -61,10 +58,8 @@ def dpnp_fill(arr, val):
61
58
)
62
59
_manager .add_event_pair (h_ev , c_ev )
63
60
return
64
- elif not isinstance (val , Number ) and not isinstance (val , np .bool_ ):
65
- raise TypeError (
66
- f"Array cannot be filled with `val` of type { type (val )} "
67
- )
61
+ else :
62
+ _validate_fill_value (val )
68
63
69
64
dt = arr .dtype
70
65
val_type = type (val )
You can’t perform that action at this time.
0 commit comments