You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replace uses of np.ndarray with npt.NDArray (pytorch#2584)
Summary:
X-link: pytorch/audio#3846
X-link: pytorch/opacus#680
X-link: pytorch/captum#1387
X-link: pytorch/audio#3845
This replaces uses of `numpy.ndarray` in type annotations with `numpy.typing.NDArray`. In Numpy-1.24.0+ `numpy.ndarray` is annotated as generic type. Without template parameters it triggers static analysis errors:
```counterexample
Generic type `ndarray` expects 2 type parameters.
```
`numpy.typing.NDArray` is an alias that provides default template parameters.
Differential Revision: D64619891
0 commit comments