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 2424# THE POSSIBILITY OF SUCH DAMAGE.
2525# *****************************************************************************
2626
27- from numbers import Number
28-
2927import dpctl .tensor as dpt
3028import 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
3330from dpctl .tensor ._tensor_impl import (
3431 _copy_usm_ndarray_into_usm_ndarray ,
3532 _full_usm_ndarray ,
@@ -61,10 +58,8 @@ def dpnp_fill(arr, val):
6158 )
6259 _manager .add_event_pair (h_ev , c_ev )
6360 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 )
6863
6964 dt = arr .dtype
7065 val_type = type (val )
You can’t perform that action at this time.
0 commit comments