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
mobile
__init__.py
_async.py
_await.py
_builtins.py
_check.py
_dataclass_impls.py
_decomposition_utils.py
_decompositions.py
_freeze.py
_fuser.py
_ir_utils.py
_logging.py
_monkeytype_config.py
_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
_serialization.py
_shape_functions.py
_state.py
_trace.py
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
quantized.py
supported_ops.py
unsupported_tensor_ops.py