
    i                     `    S SK r S SKJrJr  S SKJrJr  SSKJr  \R                  4S\4S jjr
g)    N)!get_symmetric_quantization_configXNNPACKQuantizer)convert_pt2eprepare_pt2e   )	QuantType
quant_typec                 j   [         R                  " SU  35        [        5       nU[        R                  :H  =(       d    U[        R
                  :H  nU[        R
                  :H  n[        UUS9nUR                  U5        [        X5      nU" U6   [        U5      n[         R                  " SU 35        U$ )zLThis is the official recommended flow for quantization in pytorch 2.0 exportzOriginal model: )is_per_channel
is_dynamiczQuantized model: )
logginginfor   r   STATIC_PER_CHANNELDYNAMIC_PER_CHANNELr   
set_globalr   r   )modelexample_inputsr	   	quantizerr   r   operator_configms           m/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/examples/xnnpack/quantization/utils.pyquantizer      s     LL#E7+, "I 	i222 	7666  y<<<J7%O )U&A~QALL$QC()H    )r   7executorch.backends.xnnpack.quantizer.xnnpack_quantizerr   r   'torchao.quantization.pt2e.quantize_pt2er   r    r   STATIC_PER_TENSORr    r   r   <module>r      s0    
 O  4=3N3N'0r   