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(
1111
1111
sycl_queue = sycl_queue ,
1112
1112
)
1113
1113
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
+ ):
1115
1120
raise TypeError (
1116
1121
"`full` array cannot be constructed with value of type "
1117
1122
f"{ type (fill_value )} "
@@ -1486,7 +1491,12 @@ def full_like(
1486
1491
)
1487
1492
_manager .add_event_pair (hev , copy_ev )
1488
1493
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
+ ):
1490
1500
raise TypeError (
1491
1501
"`full` array cannot be constructed with value of type "
1492
1502
f"{ type (fill_value )} "
You can’t perform that action at this time.
0 commit comments