+
    "Ý³jG  ã                   óT   a € R t0 t ^ RIt^ RIHtHtHt ^ RIt^ RIHt / t	] ^ k R t
R# )é    N)ÚCallableÚDictÚType)ÚAOBaseConfigc                óF   a € \         P                  ! S 4      V 3R l4       pV# )a"  
A decorator to register a transform function to map from a workflow
configuration (child of `AOBaseConfig`) to a function that transforms
a `torch.nn.Module` according to the specified configuration.

For example::

    # user facing code
    class WorkflowFooConfig(AOBaseConfig): ...
        # configuration for workflow `Foo` is defined here
        bar = 'baz'

    # non user facing code
    @register_quantize_module_handler(WorkflowFooConfig)
    def _transform(
        mod: torch.nn.Module,
        config: WorkflowFooConfig,
    ) -> torch.nn.Module:
        # the transform is implemented here, usually a tensor sublass
        # weight swap or a module swap
        ...

    # then, the user calls `quantize_` with a config, and `_transform` is called
    # under the hood by `quantize_.

c                 ó   <€ V \         S&   V # )N)Ú_QUANTIZE_CONFIG_HANDLER)ÚfuncÚconfig_types   &€Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchao/quantization/transform_module.pyÚ	decoratorÚ3register_quantize_module_handler.<locals>.decorator/   s   ø€ à04Ô  Ñ-Øˆó    )Ú	functoolsÚwraps)r   r   s   f r   Ú register_quantize_module_handlerr      s(   ø€ ô8 ‡_‚_�[Ó!ôó "ðð Ðr   c                óö   € V ^8„  d   Qh/ ^ \         9   de   \        \        \        ,          \        \
        P                  P                  \        .\
        P                  P                  3,          3,          ;R&   # )é   r	   )Ú__conditional_annotations__r   r   r   r   ÚtorchÚnnÚModule)Úformats   "r   Ú__annotate__r      sS   € × Ñ ÷ò œ$ÜŒÕÜŒe�h‰h�o‰oœ|Ð,¬e¯h©h¯o©oÐ=Õ>ð@õñ ò r   )r   r   Útypingr   r   r   r   Útorchao.core.configr   r	   r   r   )r   s   @r   Ú<module>r      s.   øð÷ Ð ß 'Ñ 'ã å ,ð
 ð ó ô!r   