
    [Th                         S SK Jr   " S S\R                  5      r " S S\R                  5      r " S S\R                  5      rg)	    )nnc                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )	QuantStub   a  Quantize stub module, before calibration, this is same as an observer,
it will be swapped as `nnq.Quantize` in `convert`.

Args:
    qconfig: quantization configuration for the tensor,
        if qconfig is not provided, we will get qconfig from parent modules
c                 >   > [         TU ]  5         U(       a  Xl        g g Nsuper__init__qconfigselfr   	__class__s     S/var/www/auris/envauris/lib/python3.13/site-packages/torch/ao/quantization/stubs.pyr   QuantStub.__init__       "L     c                     U$ r    r   xs     r   forwardQuantStub.forward       r   r   r   	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classcell__r   s   @r   r   r          #
 r   r   c                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )DeQuantStub   a  Dequantize stub module, before calibration, this is same as identity,
this will be swapped as `nnq.DeQuantize` in `convert`.

Args:
    qconfig: quantization configuration for the tensor,
        if qconfig is not provided, we will get qconfig from parent modules
c                 >   > [         TU ]  5         U(       a  Xl        g g r   r	   r   s     r   r   DeQuantStub.__init__!   r   r   c                     U$ r   r   r   s     r   r   DeQuantStub.forward&   r   r   r   r   r   r$   s   @r   r'   r'      r%   r   r'   c                   f   ^  \ rS rSr% Sr\\S'   \\S'   \R                  \S'   U 4S jr
S rSrU =r$ )	QuantWrapper*   a  A wrapper class that wraps the input module, adds QuantStub and
DeQuantStub and surround the call to module with call to quant and dequant
modules.

This is used by the `quantization` utility functions to add the quant and
dequant modules, before `convert` function `QuantStub` will just be observer,
it observes the input tensor, after `convert`, `QuantStub`
will be swapped to `nnq.Quantize` which does actual quantization. Similarly
for `DeQuantStub`.
quantdequantmodulec                   > [         TU ]  5         [        USS 5      nU R                  S[	        U5      5        U R                  S[        U5      5        U R                  SU5        U R                  UR                  5        g )Nr   r0   r1   r2   )r
   r   getattr
add_moduler   r'   traintraining)r   r2   r   r   s      r   r   QuantWrapper.__init__9   s`    &)T27!34	;w#78&)

6??#r   c                 h    U R                  U5      nU R                  U5      nU R                  U5      $ r   )r0   r2   r1   )r   Xs     r   r   QuantWrapper.forwardA   s*    JJqMKKN||Ar   r   )r   r   r   r    r!   r   __annotations__r'   r   Moduler   r   r"   r#   r$   s   @r   r.   r.   *   s/    	 II$ r   r.   N)torchr   r=   r   r'   r.   r   r   r   <module>r?      s:    		 $")) $299 r   