Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace uses of np.ndarray with npt.NDArray in type annotations #387

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

Commits on Oct 1, 2024

  1. replace uses of np.ndarray with npt.NDArray in type annotations (face…

    …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
    igorsugak authored and facebook-github-bot committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    df7c093 View commit details
    Browse the repository at this point in the history