File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1111,7 +1111,12 @@ def full(
11111111 sycl_queue = sycl_queue ,
11121112 )
11131113 return dpt .copy (dpt .broadcast_to (X , shape ), order = order )
1114- elif not isinstance (fill_value , Number ):
1114+ # TODO: verify if `np.True_` and `np.False_` should be instances of
1115+ # Number in NumPy, like other NumPy scalars and like Python bools
1116+ # check for `np.bool_` separately as NumPy<2 has no `np.bool`
1117+ elif not isinstance (fill_value , Number ) and not isinstance (
1118+ fill_value , np .bool_
1119+ ):
11151120 raise TypeError (
11161121 "`full` array cannot be constructed with value of type "
11171122 f"{ type (fill_value )} "
@@ -1486,7 +1491,12 @@ def full_like(
14861491 )
14871492 _manager .add_event_pair (hev , copy_ev )
14881493 return res
1489- elif not isinstance (fill_value , Number ):
1494+ # TODO: verify if `np.True_` and `np.False_` should be instances of
1495+ # Number in NumPy, like other NumPy scalars and like Python bools
1496+ # check for `np.bool_` separately as NumPy<2 has no `np.bool`
1497+ elif not isinstance (fill_value , Number ) and not isinstance (
1498+ fill_value , np .bool_
1499+ ):
14901500 raise TypeError (
14911501 "`full` array cannot be constructed with value of type "
14921502 f"{ type (fill_value )} "
You can’t perform that action at this time.
0 commit comments