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:
Generic type `ndarray` expects 2 type parameters.
numpy.typing.NDArray is an alias that provides default template parameters.
Summary: X-link: https://github.com/pytorch/captum/pull/1389
X-link: https://github.com/pytorch/botorch/pull/2586
X-link: https://github.com/pytorch/audio/pull/3846
X-link: https://github.com/pytorch/captum/pull/1387 X-link: https://github.com/pytorch/botorch/pull/2584 X-link: https://github.com/pytorch/audio/pull/3845
This replaces uses of
numpy.ndarray
in type annotations withnumpy.typing.NDArray
. In Numpy-1.24.0+numpy.ndarray
is annotated as generic type. Without template parameters it triggers static analysis errors:numpy.typing.NDArray
is an alias that provides default template parameters.Differential Revision: D64619891