apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.77k stars 6.79k forks source link

[BUGFIX] utils.py - bool = bool #21223

Open mwunderl opened 11 months ago

mwunderl commented 11 months ago

Description

Importing mxnet with numpy 1.20+ results in

AttributeError: module 'numpy' has no attribute 'bool'. np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

np.bool was a deprecated alias for the builtin bool, so replace np.bool with bool

Tested locally with mxnet-1.9.1-py3-none-manylinux2014_x86_64.whl , numpy 1.24.4, python 3.10.12

Checklist

Essentials

cf https://github.com/apache/mxnet/issues/21165

mxnet-bot commented 11 months ago

Hey @mwunderl , Thanks for submitting the PR All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: