pytorch/torch/onnx/_internal
Igor Sugak bce52d0b60 [CODEMOD][caffe2] use npt.NDArray instead of np.ndarray in type annotations (#136288)
Summary:
To facilitate PSS-2 upgrade, this uses `ndt.NDArray` instead of `nd.ndarray` in type annotations. In Numpy-1.19 (PSS-1) it's an 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 this Pyre type error:
```counterexample
 Invalid type parameters [24]: Generic type `np.ndarray` expects 2 type parameters.
```

Test Plan: Sandcastle plus visual inspection

Differential Revision: D62977370

Pull Request resolved: https://github.com/pytorch/pytorch/pull/136288
Approved by: https://github.com/kit1980
2024-09-19 12:40:36 +00:00
..
diagnostics [ONNX] Opt into ruff fmt (#134120) 2024-08-22 22:44:03 +00:00
exporter [CODEMOD][caffe2] use npt.NDArray instead of np.ndarray in type annotations (#136288) 2024-09-19 12:40:36 +00:00
fx [ONNX] Run type promotion test in CI and update the table (#135915) 2024-09-16 16:46:13 +00:00
__init__.py
_exporter_legacy.py [ONNX] Update fake mode usage in onnx docs (#135512) 2024-09-11 21:29:04 +00:00
_lazy_import.py [ONNX] Use the stable APIs in onnxscript and sync the latest logic (#134782) 2024-09-04 03:10:20 +00:00
io_adapter.py [ONNX] Opt into ruff fmt (#134120) 2024-08-22 22:44:03 +00:00
jit_utils.py [BE][Easy][19/19] enforce style for empty lines in import segments in torch/[o-z]*/ (#129771) 2024-08-01 17:07:14 +00:00
onnx_proto_utils.py [ONNX] Run ruff pyupgrade to update type annotations (#130657) 2024-07-19 05:09:44 +00:00
onnxruntime.py [ONNX] Delete op_level_debug from torch.onnx.ExportOptions (#134961) 2024-09-02 23:38:39 +00:00
registration.py [ONNX] Opt into ruff fmt (#134120) 2024-08-22 22:44:03 +00:00