pytorch/torch/onnx/_internal
Justin Chu 67b14ce8bd [ONNX] Fix numpy method to return the correct type (#136162)
Previous implementation of the `numpy()` method returns `fp64` when the tensor is `fp32`. This is unexpected but seems to be caused by calling `__array__(dtype=None)` on the numpy array. I updated the implementation to implement the `numpy()` method explicitly and added tests to guard the behavior.

This needs to be cherry-picked into torch 2.5
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136162
Approved by: https://github.com/gramalingam, https://github.com/xadupre
2024-09-17 15:51:00 +00:00
..
diagnostics [ONNX] Opt into ruff fmt (#134120) 2024-08-22 22:44:03 +00:00
exporter [ONNX] Fix numpy method to return the correct type (#136162) 2024-09-17 15:51:00 +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