pytorch/torch/jit
Ivan Dimitrov 8fdd61bc45 Fix torchscript issues with reference quantized modules (#150870)
Summary:
The reference quantized modules for linear / conv / etc fail to torchscript due to two issues

(1) The type of torch.qscheme doesn't script
(2) The "_DTYPE_TO_QVALUE_BOUNDS" values were resolving to union[float, int] instead of just int. We fix that with a hard cast.

See: <internal post> + comments for more context

Test Plan: unit tests + fixing this NB N6923590

Differential Revision: D72652616

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150870
Approved by: https://github.com/jerryzh168
2025-04-10 20:14:45 +00:00
..
_passes Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
mobile [BE][Easy][17/19] enforce style for empty lines in import segments in torch/[a-c]*/ and torch/[e-n]*/ (#129769) 2024-08-04 10:24:09 +00:00
__init__.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_async.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_await.py [BE][Easy][17/19] enforce style for empty lines in import segments in torch/[a-c]*/ and torch/[e-n]*/ (#129769) 2024-08-04 10:24:09 +00:00
_builtins.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_check.py
_dataclass_impls.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_decomposition_utils.py
_decompositions.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_freeze.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_fuser.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_ir_utils.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_logging.py [BE][Easy][17/19] enforce style for empty lines in import segments in torch/[a-c]*/ and torch/[e-n]*/ (#129769) 2024-08-04 10:24:09 +00:00
_monkeytype_config.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_pickle.py PEP585 update - mostly toplevels (#145178) 2025-01-22 02:21:14 +00:00
_recursive.py Fix torchscript issues with reference quantized modules (#150870) 2025-04-10 20:14:45 +00:00
_script.py scriptfunction: Make sure we have valid __name__ and __qualname__ (#147906) 2025-02-28 23:25:47 +00:00
_script.pyi Remove some unused type ignores (round 1) (#142325) 2024-12-09 18:23:46 +00:00
_serialization.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_shape_functions.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_state.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
_trace.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
annotations.py Fix torchscript issues with reference quantized modules (#150870) 2025-04-10 20:14:45 +00:00
frontend.py PEP585: More UP006 fixes (#146392) 2025-02-20 06:18:13 +00:00
generate_bytecode.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00
quantized.py
supported_ops.py [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
unsupported_tensor_ops.py Apply Ruff fixes and pyupgrade to torch/jit (#144208) 2025-01-16 00:28:50 +00:00