
    ёi'                        S S/S//S S/S//S S/S//SS/S//SS/S//SS/S//S.r 0 SSS/S//_SSS/S//_S	SS/S//_S
S/S//_SSS/S//_SS/S//_SS/S//_SS/S//_SS/S//_SSS/S//_SS/S//_SSS/S//_SSS/S//_SSS/S//_SSS/S//_SS/S//_SSS/S//_0 SS/S//_SS/S//_SS/S//_SS/S//_SS/S//_SS /S//_SS/S//_SSS/S//_S S/S//_S!S/S//_S"S/S//_S#SS$/S//_S%S/S//_S&S/S//_S'S/S//_S(S/S//_S)S/S//_E0 S*S/S//_S+SS/S//_S,SS/S//_S-S/S//_S.S/S//_S/S S0/S1//_S2S S0/S1//_S3S/S//_S4S/S//_S5S/S//_S6S/S//_S7S/S//_S8S/S//_S9S/S//_S:S/S//_S;S/S//_S<S/S//_E0 S=S/S//_S>S /S//_S?S/S//_S@S/S//_SAS/S//_SBS/S//_SCS/S//_SDSE/SF//_SGS/S//_SHS/S//_SIS/S//_SJS/S//_SK/ S//_SLS/S//_SMS/S//_SNSOSP/S//_SQSOSP/S//_E0 SRS/SS//_STS/S//_SUS/S//_SVS/S//_SWS/S//_SXS/SSY//_SZSS/S//_S[S/S//_S\S/S//_S]SS^/S//_S_S /S//_S`/ SaQS//_SbSSc/S//_SdS/S//_SeS// SfQ/_SgS/S//_ShS/S//_ES/S//S/S//S/S//S/S//Si.Er\ R                  5       r\R	                  \5         " Sj Sk5      r " Sl Sm\5      r " Sn So\5      rgp)qInputFilterOutputXYOut)conv2ddepthwise_conv2dconv2d_transposemulmatmul	matmul_v2r   r   r   pool2delementwise_addconcatsoftmaxargmax	transposeequalgathergreater_equalgreater_than
less_equal	less_thanmean	not_equalreshapereshape2
transpose2nearest_interptrilinear_interpslicesqueezeelementwise_subrelurelu6
leaky_relupreluAlphatanhswishdropout
batch_norm
layer_normsigmoidelementwise_mulelementwise_pow
hard_swishhard_sigmoidgruWeightHiddenlstmpad2dpad3dflattenflatten2
unsqueeze2flatten_contiguous_rangesplitsqueeze2nearest_interp_v2bilinear_interpbilinear_interp_v2fill_constant_batch_size_likearg_maxabsassigncastclip	box_coderPriorBox	OutputBoxcropcumsum	expand_v2fill_any_likefill_constantgeluinstance_normlookup_tableWIdslookup_table_v2normNormp_normpowreduce_meanstacktop_k_v2Indiceslogical_andlogical_notmeshgrid	roi_alignROIsstrided_slicewhere)	Conditionr   r   grid_samplerGridtile
group_norm)r   MeanVariance
reduce_sumsquare)softplusshuffle_channel
reduce_maxscalec                   V    \ rS rSrSr/ S4S jr\S 5       r\S 5       r\S 5       r	Sr
g	)
BaseQuantizer   a[  
Basic quantization configuration class, which configures some hyperparameters
required for quantization, including the list of op types to be quantized,
quantization bit number for weight and activation and the range of quantization values.
Args:
    quantizable_op_type(list[str], optional): List the type of ops
        that will be quantized. Default is []. If quantizable_op_type is [],
        it will use the default quantization op type of the qunat config in
        the current Quantizer.
    quant_bits(int, optional): Quantization bit number for weight and activation.
        Default is 8.
   c                 8    Xl         X l        SU l        SU l        g Nirt   )_quantizable_op_type_quant_bits
_quant_min
_quant_max)selfquantizable_op_type
quant_bitss      g/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/static/quantization/quant_config.py__init__BaseQuantizer.__init__   s    
 %8!%    c                     [        [        R                  5       5      nU R                  (       a/  / nU R                   H  nX1;   d  M
  UR	                  U5        M     U$ U$ )z{
Operation type list which should support weight quantization.
And before these ops, quant dequant nodes will be inserted.
)list#SUPPORT_WEIGHT_QUANTIZATION_OP_DICTkeysrx   append)r|   base_weight_op_type_listweight_list_op_types       r   weight_quant_operation_types*BaseQuantizer.weight_quant_operation_types   s]     $(/446$
  $$K 557&&x0 6 ++r   c                     [        [        R                  5       5      n/ nU R                  (       a-  U R                   H  nX1;   d  M
  UR	                  U5        M     U$ / SQnU$ )
Operation type list which should support activation quantization.
And before these ops, quant dequant nodes will be inserted.
)r   r   r   )r    SUPPORT_ACT_QUANTIZATION_OP_DICTr   rx   r   )r|   base_act_op_type_listact_quant_op_listr   s       r    activation_quant_operation_types.BaseQuantizer.activation_quant_operation_types   sd     !%%E%J%J%L M$$ 554%,,X6 6 ! !
 ! r   c                 <    [        [        R                  5       5      $ )a-  
Operation type list for observer in quantization. These nodes only count the
calibration boundary scale and do not participate in the fake quantization.
In order to facilitate the deployment of the prediction engine, quant
and dequant nodes will be inserted after these ops when exporting the model.
)r   r   r   r|   s    r   observer_operation_types&BaseQuantizer.observer_operation_types   s     499;<<r   ry   r{   rz   rx   N)__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r   __static_attributes__ r   r   rs   rs      sP      , ," ! !& = =r   rs   c                   D   ^  \ rS rSrSr/ S4U 4S jjr\S 5       rSrU =r	$ )TensorRTQuantizer   a  
TensorRT quantization configuration class.
Args:
    quantizable_op_type(list[str], optional): List the type of ops
        that will be quantized. Default is []. If quantizable_op_type is [],
        it will use the default quantization op type of the qunat config in
        the current Quantizer.
    quant_bits(int, optional): Quantization bit number for weight and activation.
        Default is 8.
ru   c                 V   > [         TU ]  5         Xl        X l        SU l        SU l        g rw   superr   rx   ry   rz   r{   r|   r}   r~   	__class__s      r   r   TensorRTQuantizer.__init__   *    
 	$7!%r   c                 
    / SQ$ )r   )!r   r   r#   r/   r0   r   r   r   r   r$   r%   r&   r)   r*   rn   rP   r2   r1   r.   r-   r   r=   r@   r   r    r?   r@   rA   rG   rY   rZ   rl   rp   r   r   s    r   r   2TensorRTQuantizer.activation_quant_operation_types   s    "
 "	
r   r   )
r   r   r   r   r   r   r   r   r   __classcell__r   s   @r   r   r      s)    	 	 '
 '
r   r   c                   4   ^  \ rS rSrSr/ S4U 4S jjrSrU =r$ )ARMCPUQuantizeri
  a  
ARM CPU with Paddle Lite quantization configuration class.
Args:
    quantizable_op_type(list[str], optional): List the type of ops
        that will be quantized. Default is []. If quantizable_op_type is [],
        it will use the default quantization op type of the qunat config in
        the current Quantizer.
    quant_bits(int, optional): Quantization bit number for weight and activation.
        Default is 8.
ru   c                 V   > [         TU ]  5         Xl        X l        SU l        SU l        g )Nirt   r   r   s      r   r   ARMCPUQuantizer.__init__  r   r   r   )r   r   r   r   r   r   r   r   r   s   @r   r   r   
  s    	 	 	r   r   N)r   r   copySUPPORT_QUANTIZATION_OP_DICTupdaters   r   r   r   r   r   <module>r      s  & "XJ/!8,xj9!8,xj9#J SzE7#*ug&' #Z$	S#J Z$SzE7#Z$ 3*ug&Z$ uug	Z$
 c
UG,Z$ uugZ$ wZ$ uugZ$ 3%%!Z$ sCj5'"Z$ uugZ$ sCj5'*Z$ c3Z%)Z$ C:w'Z$ 3*ug&Z$  cUUG!Z$" 3*ug&#Z$$ w%Z$& # 'Z$( C55'")Z$* uug&+Z$, #(-Z$. wi%!/Z$0 w1Z$2 c
UG,3Z$4 cUUG5Z$6 seeW7Z$8 C55'"9Z$: sGnug&;Z$< cUUG=Z$> seeW?Z$@ wAZ$B C53%.CZ$D C53%.EZ$F wGZ$H c
UG,IZ$J c
UG,KZ$L C55'"MZ$N cUUG$OZ$P 
Wh(,QZ$R gx 8*-SZ$T seeWUZ$V seeWWZ$X wYZ$Z # [Z$\ C55'"]Z$^ # 0_Z$` seeWaZ$b # cZ$d 3%%)eZ$f w'gZ$h C55'*iZ$j $wi%%9kZ$l wmZ$n 
SEE7oZ$p uugqZ$r cUUGsZ$t cUUGuZ$v :,.wZ$x cUUGyZ$z uug{Z$| 3%%!}Z$~ seeW%Z$@ b5']AZ$B cUUGCZ$D secU^EZ$F c5\E7+GZ$H eug.IZ$J cUVHKZ$L uugMZ$N 
SEE7OZ$P SEE7#QZ$R secU^SZ$T #	*+UZ$V S#J(WZ$X SEE7#YZ$Z # [Z$\ 3-%)]Z$^ wi%)_Z$` %w/aZ$b c6]XJ/cZ$d cUUGeZ$f C534gZ$h C55'"iZ$j uugkZ$l  w'55'"eeWsZ$  |  CGGI   # #$D EF= F=R?
 ?
Dm r   