
    IЦi                     N   % S SK JrJrJrJrJrJr  S SKrS SKJ	r	  S SK
Jr  S SKJr  / SQr\" SS9S\S	\S
\4S j5       r\R                  R$                  R&                  R(                  SSS/\4\R                  R$                  R*                  R,                  S/ SQ\4\R                  R$                  R.                  R0                  S/ SQ\4\R                  R$                  R2                  R4                  S/ \4\R                  R$                  R2                  R6                  S/ SQ\4\R                  R$                  R8                  R:                  SS/\40r\\\\\\   \\\/\4   4   4   \S'   \" SS9S\	R@                  S
\\\4   4S j5       r!\" SS9S\S
S4S j5       r"g)    )AnyCallableDictListTupleTypeN)compatibility)GraphModule)default_matchingextract_attrs_for_loweringlift_lowering_attrs_to_nodesF)is_backward_compatiblenametarget_versionreturnc                     U $ )zDefault matching method )r   r   s     Z/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/fx/passes/param_fetch.pyr   r      s	     K       weightbias)r   r   kernel_sizestridepaddingdilationgroupspadding_mode   )r   r   running_meanrunning_vareps)r   r   r   r   return_indices	ceil_modeinplacemodule_fetch_bookmodc           	         0 n[         R                  " U 5      US'   [        U 5      [        ;   a  [        [        U 5         u  p#nX R                  :  a3  [        SU S[         R                  " U 5       SU R                   S35      eU H   n[        X" XPR                  5      5      X'   M"     U$ [        [         R                  " U 5       S35      e)zIf `mod` is in `module_fetch_book`, fetch the mod's attributes that in the `module_fetch_book`
after checking module's version is compatible with the `module_fetch_book`.
r   zFetcher version z try to fetch z	 version zl, please upgrade the module_fetch_book, open an issue and @842974287 or report a bug to AIACC team directly.z is not in the module_fetch_book yet, please add it to the module_fetch_book, open an issue and @842974287 or report a bug to AIACC team directly.)torchtypenametyper&   _versionRuntimeErrorgetattr)r'   attrs_for_loweringversionparam_to_fetchmatching_methodattrs         r   r   r   9   s    
 *,!&!4vCy%%3DT#Y3O0\\!"7)>%..:M9NiX[XdXdWe f: : 
 #D'.sOD,,4W'X$ #  ~~c"# $6 6
 	
r   	fx_modulec                 @   [        U R                  5       5      nU R                  R                   Hk  nUR                  S:X  d  M  [        XR                     [        5      (       a  [        XR                     5        MO  [        XR                     5      Ul
        Mm     g)zjRecursively traverse all `fx_module` nodes and fetch the module's attributes if the node is a leaf module.call_moduleN)dictnamed_modulesgraphnodesop
isinstancetargetr
   r   r   r/   )r4   
submodulesnodes      r   r   r   T   sq     i--/0J%%77m#*[[1;??,Z-DE*D{{++' &r   )#typingr   r   r   r   r   r   r)   torch.nnnntorch.fx._compatibilityr	   torch.fx.graph_moduler
   __all__strintr   moduleslinearLinearconvConv2d	batchnormBatchNorm2dpoolingAdaptiveAvgPool2d	MaxPool2d
activationReLUr&   __annotations__Moduler   r   r   r   r   <module>rV      s   9 9 9   1 - e,3    - 
HH""Q6(:<L$M	HH  			
 	# 
HH**	@-
 
HH..B8H0I	HH&&	W)
 
HH$$q9+7G&H7S 4eCcHc3Z_4M$MNNO > e,BII $sCx.  -4 e,K D  -r   