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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mwunderl
Copy link

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

  • [ x] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • [x ] Changes are complete (i.e. I finished coding on this PR)
  • [x ] All changes have test coverage
  • [ x] Code is well-documented

cf #21165

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`
@mwunderl mwunderl requested a review from szha as a code owner October 11, 2023 20:37
@mxnet-bot
Copy link

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:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [website, miscellaneous, centos-gpu, windows-gpu, windows-cpu, edge, clang, sanity, unix-gpu, centos-cpu, unix-cpu]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-work-in-progress PR is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants