Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 2e36e61

Browse files
committed
Remove type onp.bool.
- `np.bool` was a deprecated alias for the builtin `bool` with version 1.20.
1 parent b84609d commit 2e36e61

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

python/mxnet/numpy/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
int8 = onp.dtype(onp.int8)
3939
int64 = onp.dtype(onp.int64)
4040
bool_ = onp.dtype(onp.bool_)
41-
bool = onp.dtype(onp.bool)
4241
int16 = onp.dtype(onp.int16)
4342
uint16 = onp.dtype(onp.uint16)
4443
uint32 = onp.dtype(onp.uint32)

tests/python/unittest/test_numpy_op.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ def forward(self, a, mask, value):
20942094
if test_data.size == 0:
20952095
break
20962096
valid_num = int(mx_mask.asnumpy().sum())
2097-
np_mask = mx_mask.asnumpy().astype(onp.bool)
2097+
np_mask = mx_mask.asnumpy().astype(onp.bool_)
20982098
vshape = []
20992099
vshape_broadcast = []
21002100
for i in range(len(dshape)):
@@ -5587,7 +5587,7 @@ def forward(self, a):
55875587
for shape in shapes:
55885588
for axis in [None] + [i for i in range(0, len(shape))]:
55895589
for otype in [None, onp.int32, onp.int64]:
5590-
for itype in [onp.bool, onp.int8, onp.int32, onp.int64]:
5590+
for itype in [onp.bool_, onp.int8, onp.int32, onp.int64]:
55915591
x = rand_ndarray(shape).astype(itype).as_np_ndarray()
55925592
np_out = onp.cumsum(x.asnumpy(), axis=axis, dtype=otype)
55935593
mx_out = np.cumsum(x, axis=axis, dtype=otype)

0 commit comments

Comments
 (0)