Commit b5d53f2
replace uses of np.ndarray with npt.NDArray (#681)
Summary:
Pull Request resolved: #681
X-link: meta-pytorch/captum#1389
X-link: meta-pytorch/botorch#2586
X-link: pytorch/audio#3846
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.
Reviewed By: ryanthomasjohnson
Differential Revision: D64619891
fbshipit-source-id: dffc096b1ce90d11e73d475f0bbcb8867ed9ef011 parent aea78b3 commit b5d53f2
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
0 commit comments