-
Notifications
You must be signed in to change notification settings - Fork 56
replace uses of np.ndarray with npt.NDArray in type annotations#387
Open
igorsugak wants to merge 1 commit intofacebookresearch:main from
Open
replace uses of np.ndarray with npt.NDArray in type annotations #387igorsugak wants to merge 1 commit intofacebookresearch:main from
igorsugak wants to merge 1 commit intofacebookresearch:main from
Conversation
@facebook-github-bot
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Sep 25, 2024
Contributor
facebook-github-bot
commented
Sep 25, 2024
This pull request was exported from Phabricator. Differential Revision: D63360858
...bookresearch#387) Summary: Pull Request resolved: facebookresearch#387 To facilitate PSS-2 upgrade, this uses `ndt.NDArray` instead of `nd.ndarray` in type annotations. It was backported to Numpy-1.19 (PSS-1) as alias to `nd.ndarray` -- a noop. In Numpy-1.24, `ndt.NDArray` a proper generic type, and without this change uses of `nd.ndarray` generate the following Pyre error: ```counterexample Invalid type parameters [24]: Generic type `np.ndarray` expects 2 type parameters. ``` Reviewed By: florazzz Differential Revision: D63360858
Contributor
facebook-github-bot
commented
Oct 1, 2024
This pull request was exported from Phabricator. Differential Revision: D63360858
@igorsugak
igorsugak
force-pushed
the
export-D63360858
branch
from
October 1, 2024 02:04
4109d1c to
df7c093
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
To facilitate PSS-2 upgrade, this uses
ndt.NDArrayinstead ofnd.ndarrayin type annotations. It was backported to Numpy-1.19 (PSS-1) as alias tond.ndarray-- a noop. In Numpy-1.24,ndt.NDArraya proper generic type, and without this change uses ofnd.ndarraygenerate the following Pyre error:Differential Revision: D63360858