Commit 7bcc5e8
authored
Updates references to numpy deprecated type aliases. (#6140)
Numpy library deprecated some type aliases in version 1.20.0 [1], and
then removed them in version 1.24.0 [2], which was released on Dec 18,
2022.
Without this change, our build would be broken when using numpy version
>= 1.24.0,
with error `AttributeError: module 'numpy' has no attribute 'float'`.
The fix suggested in release notes from numpy version 1.20.0 is to
replace these types with the equivalent primitive python types. (In this
case, simply `float`.)
[1]
http://numpy.org/doc/stable/release/1.20.0-notes.html#using-the-aliases-of-builtin-types-like-np-int-is-deprecated
[2]
http://numpy.org/doc/stable/release/1.24.0-notes.html#expired-deprecations
* Motivation for features / changes
Newer numpy versions break our build. This code is exactly equivalent,
as the identifiers used previously were aliases for the same type.
* Technical description of changes
Replace occurrences of `np.float` for the primitive type `float`.
* Screenshots of UI changes
N/A
* Detailed steps to verify changes work correctly (as executed by you)
Ran tests.
* Alternate designs / implementations considered
N/A.1 parent 183ff2b commit 7bcc5e8
File tree
2 files changed
+2
-2
lines changed- tensorboard/plugins
- npmi
- pr_curve
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
0 commit comments