
    ڧgA                     
   U d dl Z d dlmZ d dlmZ d dlmZmZmZm	Z	m
Z
mZ d dlZd dlmZmZ ddlmZmZ ddlmZmZ dd	lmZ d
dlmZmZmZ d
dlmZ d
dlmZmZm Z  g dZ! G d de          Z" G d dej#                  Z$ G d dej%                  Z& G d dej#                  Z' G d d          Z( G d dej%                  Z)de(de
e         de*dede)f
d Z+d!ed"Z,ee-ef         e.d#<   i e,d$d%d&Z/ G d' d(e          Z0 G d) d*e          Z1 G d+ d,e          Z2 G d- d.e          Z3 G d/ d0e          Z4 G d1 d2e          Z5 G d3 d4e          Z6 G d5 d6e          Z7 G d7 d8e          Z8 G d9 d:e          Z9 G d; d<e          Z: G d= d>e          Z; G d? d@e          Z< G dA dBe          Z= G dC dDe          Z> e             e dEe0j?        fF          ddGdHde
e0         de*dede)fdI                        Z@ e             e dEe1j?        fF          ddGdHde
e1         de*dede)fdJ                        ZA e             e dEe2j?        fF          ddGdHde
e2         de*dede)fdK                        ZB e             e dEe3j?        fF          ddGdHde
e3         de*dede)fdL                        ZC e             e dEe4j?        fF          ddGdHde
e4         de*dede)fdM                        ZD e             e dEe5j?        fF          ddGdHde
e5         de*dede)fdN                        ZE e             e dEe6j?        fF          ddGdHde
e6         de*dede)fdO                        ZF e             e dPF          ddGdHde
e7         de*dede)fdQ                        ZG e             e dEe8j?        fF          ddGdHde
e8         de*dede)fdR                        ZH e             e dEe9j?        fF          ddGdHde
e9         de*dede)fdS                        ZI e             e dEe:j?        fF          ddGdHde
e:         de*dede)fdT                        ZJ e             e dEe;j?        fF          ddGdHde
e;         de*dede)fdU                        ZK e             e dEe<j?        fF          ddGdHde
e<         de*dede)fdV                        ZL e             e dEe=j?        fF          ddGdHde
e=         de*dede)fdW                        ZM e             e dEe>j?        fF          ddGdHde
e>         de*dede)fdX                        ZNdS )Y    N)OrderedDict)partial)AnyCallableDictListOptionalTuple)nnTensor   )Conv2dNormActivationSqueezeExcitation)ImageClassificationInterpolationMode)_log_api_usage_once   )register_modelWeightsWeightsEnum)_IMAGENET_CATEGORIES)_make_divisible_ovewrite_named_paramhandle_legacy_interface)RegNetRegNet_Y_400MF_WeightsRegNet_Y_800MF_WeightsRegNet_Y_1_6GF_WeightsRegNet_Y_3_2GF_WeightsRegNet_Y_8GF_WeightsRegNet_Y_16GF_WeightsRegNet_Y_32GF_WeightsRegNet_Y_128GF_WeightsRegNet_X_400MF_WeightsRegNet_X_800MF_WeightsRegNet_X_1_6GF_WeightsRegNet_X_3_2GF_WeightsRegNet_X_8GF_WeightsRegNet_X_16GF_WeightsRegNet_X_32GF_Weightsregnet_y_400mfregnet_y_800mfregnet_y_1_6gfregnet_y_3_2gfregnet_y_8gfregnet_y_16gfregnet_y_32gfregnet_y_128gfregnet_x_400mfregnet_x_800mfregnet_x_1_6gfregnet_x_3_2gfregnet_x_8gfregnet_x_16gfregnet_x_32gfc            
       l     e Zd ZdZdedededej        f         dedej        f         ddf
 fd	Z xZ	S )
SimpleStemINz(Simple stem for ImageNet: 3x3, BN, ReLU.width_in	width_out
norm_layer.activation_layerreturnNc                 V    t                                          ||dd||           d S )N   r   kernel_sizestrider>   r?   )super__init__)selfr<   r=   r>   r?   	__class__s        U/var/www/html/ai-engine/env/lib/python3.11/site-packages/torchvision/models/regnet.pyrG   zSimpleStemIN.__init__7   s>     	iQqZbr 	 	
 	
 	
 	
 	
    )
__name__
__module____qualname____doc__intr   r   ModulerG   __classcell__rI   s   @rJ   r;   r;   4   s        22	
	
 	
 S")^,		

 #3	>2	
 
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
rK   r;   c                        e Zd ZdZdededededej        f         dedej        f         ded	ed
e	e         ddf fdZ
 xZS )BottleneckTransformz/Bottleneck transformation: 1x1, 3x3 [+SE], 1x1.r<   r=   rE   r>   .r?   group_widthbottleneck_multiplierse_ratior@   Nc	           	         t                      }	t          t          ||z                      }
|
|z  }t          ||
dd||          |	d<   t          |
|
d||||          |	d<   |r4t          t          ||z                      }t	          |
||          |	d<   t          |
|dd|d           |	d	<   t                                          |	           d S )
Nr   rC   arB   )rD   rE   groupsr>   r?   b)input_channelssqueeze_channels
activationsec)r   rP   roundr   r   rF   rG   )rH   r<   r=   rE   r>   r?   rV   rW   rX   layersw_bgwidth_se_outrI   s                rJ   rG   zBottleneckTransform.__init__F   s    /:mm%	$99::;;;*cqz\l
 
 
s +!F1fv
 
 
s  	 uX%899::L,"!-+  F4L +!
]a
 
 
s 	     rK   rL   rM   rN   rO   rP   r   r   rQ   floatr	   rG   rR   rS   s   @rJ   rU   rU   C   s        99#!#! #! 	#!
 S")^,#! #3	>2#! #!  %#! 5/#! 
#! #! #! #! #! #! #! #! #! #!rK   rU   c                        e Zd ZdZ	 	 	 ddedededed	ej        f         d
ed	ej        f         dedede	e         ddf fdZ
dedefdZ xZS )ResBottleneckBlockz>Residual bottleneck block: x + F(x), F = bottleneck transform.r         ?Nr<   r=   rE   r>   .r?   rV   rW   rX   r@   c	           
          t                                                       d | _        ||k    p|dk    }	|	rt          ||d||d           | _        t	          ||||||||          | _         |d          | _        d S )Nr   rC   T)inplace)rF   rG   projr   rU   fr_   )rH   r<   r=   rE   r>   r?   rV   rW   rX   should_projrI   s             rJ   rG   zResBottleneckBlock.__init__o   s     	 	9,>&A+ 	,)6jko  DI %!	
 	
 +*4888rK   xc                     | j         ,|                      |          |                     |          z   }n||                     |          z   }|                     |          S N)rn   ro   r_   rH   rq   s     rJ   forwardzResBottleneckBlock.forward   sO    9 		!tvvayy(AADFF1IIAq!!!rK   )r   rk   N)rL   rM   rN   rO   rP   r   r   rQ   rh   r	   rG   r   ru   rR   rS   s   @rJ   rj   rj   l   s        HH '*$(9 99 9 	9
 S")^,9 #3	>29 9  %9 5/9 
9 9 9 9 9 9@" "F " " " " " " " "rK   rj   c                        e Zd ZdZ	 	 ddededededed	ej        f         d
ed	ej        f         ded	ej        f         dedede	e         deddf fdZ
 xZS )AnyStagez;AnyNet stage (sequence of blocks w/ the same output shape).Nr   r<   r=   rE   depthblock_constructor.r>   r?   rV   rW   rX   stage_indexr@   c                     t                                                       t          |          D ]@} ||dk    r|n|||dk    r|nd||||	|
          }|                     d| d| |           Ad S )Nr   r   block-)rF   rG   range
add_module)rH   r<   r=   rE   rx   ry   r>   r?   rV   rW   rX   rz   ir|   rI   s                 rJ   rG   zAnyStage.__init__   s     	u 	> 	>A%%FF	q&&a %	 	E OO5K55!55u====	> 	>rK   )Nr   rg   rS   s   @rJ   rw   rw      s        EE %)> >> > 	>
 > $CN3> S")^,> #3	>2> >  %> 5/> > 
> > > > > > > > > >rK   rw   c                   F   e Zd Z	 ddee         dee         dee         dee         dee         dee         ddfd	Ze	 	 ddededededededee         de	dd fd            Z
d Zedee         dee         dee         deee         ee         f         fd            ZdS )BlockParamsNdepthswidthsgroup_widthsbottleneck_multipliersstridesrX   r@   c                 Z    || _         || _        || _        || _        || _        || _        d S rs   r   r   r   r   r   rX   )rH   r   r   r   r   r   rX   s          rJ   rG   zBlockParams.__init__   s4     (&<# rK   rk   rx   w_0w_aw_mrV   rW   kwargsc           	         d}	d}
|dk     s|dk    s|dk    s	|dz  dk    rt          d          t          j        |          |z  |z   }t          j        t          j        ||z            t          j        |          z            }t          j        t          j        |t          j        ||          z  |	                    |	z                                  	                                }t          t          |                    }t          |dgz   dg|z   |dgz   dg|z             }d |D             }d t          ||dd	                   D             }t          j        t          j        d
 t          |          D                                                                 	                                }|
g|z  }|g|z  }|g|z  }|                     |||          \  }} | ||||||          S )a)  
        Programmatically compute all the per-block settings,
        given the RegNet parameters.

        The first step is to compute the quantized linear block parameters,
        in log space. Key parameters are:
        - `w_a` is the width progression slope
        - `w_0` is the initial width
        - `w_m` is the width stepping in the log space

        In other terms
        `log(block_width) = log(w_0) + w_m * block_capacity`,
        with `bock_capacity` ramping up following the w_0 and w_a params.
        This block width is finally quantized to multiples of 8.

        The second step is to compute the parameters per stage,
        taking into account the skip connection and the final 1x1 convolutions.
        We use the fact that the output width is constant within a stage.
           r   r   r   zInvalid RegNet settingsc                 0    g | ]\  }}}}||k    p||k    S  r   ).0wwprrps        rJ   
<listcomp>z0BlockParams.from_init_params.<locals>.<listcomp>   s-    FFFB2!r'$Q"WFFFrK   c                     g | ]	\  }}||
S r   r   )r   r   ts      rJ   r   z0BlockParams.from_init_params.<locals>.<listcomp>   s!    JJJdaJJJJrK   Nc                     g | ]	\  }}||
S r   r   )r   dr   s      rJ   r   z0BlockParams.from_init_params.<locals>.<listcomp>   s"    /U/U/UdaST/U/U/U/UrK   r   )
ValueErrortorcharangerb   logmathdividepowrP   tolistlensetzipdifftensor	enumerate"_adjust_widths_groups_compatibilty)clsrx   r   r   r   rV   rW   rX   r   QUANTSTRIDEwidths_contblock_capacityblock_widths
num_stagessplit_helpersplitsstage_widthsstage_depthsr   r   r   s                         rJ   from_init_paramszBlockParams.from_init_params   s   @ 77cQhh#((cAgll6777l5))C/#5UY{S/@%A%ADHSMM%QRRELuyn7U7U1UW\$]$]^^affkkmmttvv\**++
 A3C,A3C,	
 
 GFFFFJJc,ss&D&DJJJz%,/U/Ui>O>O/U/U/U"V"VWW[[]]ddff(Z'"7!8:!E#}z1 &)%K%K0,&
 &
"l s%#9
 
 
 	
rK   c                 Z    t          | j        | j        | j        | j        | j                  S rs   )r   r   r   r   r   r   )rH   s    rJ   _get_expanded_paramsz BlockParams._get_expanded_params  s$    4;dk4;LdNijjjrK   r   bottleneck_ratiosc                     d t          | |          D             }d t          ||          D             }d t          ||          D             }d t          ||          D             } | |fS )zl
        Adjusts the compatibility of widths and groups,
        depending on the bottleneck ratio.
        c                 8    g | ]\  }}t          ||z            S r   rP   )r   r   r\   s      rJ   r   zBBlockParams._adjust_widths_groups_compatibilty.<locals>.<listcomp>  s&    NNNA#a!e**NNNrK   c                 4    g | ]\  }}t          ||          S r   )min)r   re   w_bots      rJ   r   zBBlockParams._adjust_widths_groups_compatibilty.<locals>.<listcomp>   s$    TTThaC5MMTTTrK   c                 4    g | ]\  }}t          ||          S r   )r   )r   r   re   s      rJ   r   zBBlockParams._adjust_widths_groups_compatibilty.<locals>.<listcomp>#  s&    ZZZq/%++ZZZrK   c                 8    g | ]\  }}t          ||z            S r   r   )r   r   r\   s      rJ   r   zBBlockParams._adjust_widths_groups_compatibilty.<locals>.<listcomp>$  s&    VVV85!EAIVVVrK   )r   )r   r   r   r   group_widths_minws_bots         rJ   r   z.BlockParams._adjust_widths_groups_compatibilty  s     ON\;L)M)MNNNTT#lF:S:STTT [ZCHX<Y<YZZZVVs6CT7U7UVVV---rK   rs   )rk   N)rL   rM   rN   r   rP   rh   r	   rG   classmethodr   r   r   staticmethodr
   r   r   rK   rJ   r   r      s        %)! !S	! S	! 3i	!
 !%U! c! 5/! 
! ! ! !   (+$(F
 F
F
 F
 	F

 F
 F
  %F
 5/F
 F
 
F
 F
 F
 [F
Pk k k .3i.48K.OSTWy.	tCy$s)#	$. . . \. . .rK   r   c                        e Zd Z	 	 	 	 	 	 ddedededeedej        f                  d	eedej        f                  d
eedej        f                  deedej        f                  ddf fdZ	de
de
fdZ xZS )r         Nblock_paramsnum_classes
stem_width	stem_type.
block_typer>   r_   r@   c                 2   t                                                       t          |            |t          }|t          j        }|t          }|t          j        } |d|||          | _        |}g }	t          |
                                          D ]J\  }
\  }}}}}|	                    d|
dz    t          ||||||||||j        |
dz             f           |}Kt	          j        t          |	                    | _        t	          j        d          | _        t	          j        ||          | _        |                                 D ]E}t-          |t          j                  r`|j        d         |j        d         z  |j        z  }t          j                            |j        dt;          j        d	|z            
           }t-          |t          j                  rIt          j                            |j                   t          j                             |j!                   t-          |t          j                  rKt          j                            |j        dd
           t          j                             |j!                   Gd S )NrB   r|   r   )rz   r   r   )in_featuresout_featuresr   g               @)meanstdg{Gz?)"rF   rG   r   r;   r   BatchNorm2drj   ReLUstemr   r   appendrw   rX   
Sequentialr   trunk_outputAdaptiveAvgPool2davgpoolLinearfcmodules
isinstanceConv2drD   out_channelsinitnormal_weightr   sqrtones_zeros_bias)rH   r   r   r   r   r   r>   r_   current_widthblocksr   r=   rE   rx   rV   rW   mfan_outrI   s                     rJ   rG   zRegNet.__init__)  s~    	D!!!$IJ+JJ I	
 
	 # |88::;;	& 	& 
A 
!MM!AaCMM%!"""#-$-$%E    & &MMM+f*=*=>>+F33)KPPP  
	' 
	'A!RY'' 	'-*Q]1-==Ns	#-8P8PQQQQAr~.. 'ah'''qv&&&&Ary)) 's===qv&&&
	' 
	'rK   rq   c                     |                      |          }|                     |          }|                     |          }|                    d          }|                     |          }|S )Nr   )	start_dim)r   r   r   flattenr   rt   s     rJ   ru   zRegNet.forwardx  sZ    IIaLLa  LLOOIII""GGAJJrK   )r   r   NNNN)rL   rM   rN   r   rP   r	   r   r   rQ   rG   r   ru   rR   rS   s   @rJ   r   r   (  s         8<9=9=9=M' M'!M' M' 	M'
 HS")^45M' Xc29n56M' Xc29n56M' Xc29n56M' 
M' M' M' M' M' M'^ F        rK   r   r   weightsprogressr   r@   c                 2   |)t          |dt          |j        d                              |                    dt	          t
          j        dd                    }t          | fd|i|}|*|                    |	                    |d                     |S )	Nr   
categoriesr>   gh㈵>g?)epsmomentumT)r   
check_hash)
r   r   metapopr   r   r   r   load_state_dictget_state_dict)r   r   r   r   r>   models         rJ   _regnetr     s     fmSl9S5T5TUUUL'".eVY*Z*Z*Z[[J<AAJA&AAEg44hSW4XXYYYLrK   r   )min_sizer   _COMMON_METAz(https://github.com/facebookresearch/SWAGz:https://github.com/facebookresearch/SWAG/blob/main/LICENSE)recipelicensec                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r   z?https://download.pytorch.org/models/regnet_y_400mf-c65dace8.pth   	crop_sizeiPIB Rhttps://github.com/pytorch/vision/tree/main/references/classification#small-modelsImageNet-1KgmR@gV@zacc@1zacc@5g|?5^?guV0@XThese weights reproduce closely the results of the paper using a simple training recipe.
num_paramsr  _metrics_ops
_file_size_docsurl
transformsr   z?https://download.pytorch.org/models/regnet_y_400mf-e6988f5f.pth   r  resize_size8https://github.com/pytorch/vision/issues/3995#new-recipeg~jtR@gsh|/W@$  
                These weights improve upon the results of the original paper by using a modified version of TorchVision's
                `new training recipe
                <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_.
            N
rL   rM   rN   r   r   r   r   IMAGENET1K_V1IMAGENET1K_V2DEFAULTr   rK   rJ   r   r             GM7.#>>>

!j##     s
 
 
  M$ GM7.#3OOO

!P##     
 
 
  M, GGGrK   r   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r   z?https://download.pytorch.org/models/regnet_y_800mf-1b27b58c.pthr  r  i 'b r  r  g{GS@gbX9HW@r	  g㥛 ?g/$8@r
  r  r  z?https://download.pytorch.org/models/regnet_y_800mf-58fc7688.pthr  r  r  gES@g㥛 W@r  Nr  r   rK   rJ   r   r     r  rK   r   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r   z?https://download.pytorch.org/models/regnet_y_1_6gf-b11a554e.pthr  r  i~ r  r  g|S@g}W@r	  gn?g~jtE@r
  r  r  z?https://download.pytorch.org/models/regnet_y_1_6gf-0d7bc02a.pthr  r  r  gMb8T@g#~jW@r  Nr  r   rK   rJ   r   r     s        GM7.#>>>

"j##     s
 
 
  M$ GM7.#3OOO

"P##     
 
 
  M, GGGrK   r   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r   z?https://download.pytorch.org/models/regnet_y_3_2gf-b5a9779c.pthr  r  i2(Shttps://github.com/pytorch/vision/tree/main/references/classification#medium-modelsr  g&1S@g/ݤW@r	  g rh	@g?5^IR@r
  r  r  z?https://download.pytorch.org/models/regnet_y_3_2gf-9180c971.pthr  r  r  g+~T@g|?5W@r  Nr  r   rK   rJ   r   r   %          GM7.#>>>

"k##     s
 
 
  M$ GM7.#3OOO

"P##     
 
 
  M, GGGrK   r   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r    z=https://download.pytorch.org/models/regnet_y_8gf-d0d0e4a8.pthr  r  iXr!  r  g5^IT@gPnW@r	  gV- @gOnb@r
  r  r  z=https://download.pytorch.org/models/regnet_y_8gf-dc2b1b54.pthr  r  r  gET@gQX@r  Nr  r   rK   rJ   r    r    Q          GK7.#>>>

"k##    !s
 
 
  M$ GK7.#3OOO

"P##    !
 
 
  M, GGGrK   r    c                   v   e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          Z ed eedde	j
                  i eddddd	idddd          Z ed eedde	j
                  i edddd d!d	id
dd"d#          ZeZd$S )%r!   z>https://download.pytorch.org/models/regnet_y_16gf-9e6ed7dd.pthr  r  i{Rhttps://github.com/pytorch/vision/tree/main/references/classification#large-modelsr  gB`"T@g(\W@r	  gm/@gp=
s@r
  r  r  z>https://download.pytorch.org/models/regnet_y_16gf-3e4a00f9.pthr  r  r  gbX9T@gEX@r  zChttps://download.pytorch.org/models/regnet_y_16gf_swag-43afe44d.pth  r  r  interpolationgT㥛ĀU@g~jtX@gGz^G@
                These weights are learnt via transfer learning by end-to-end fine-tuning the original
                `SWAG <https://arxiv.org/abs/2201.08371>`_ weights on ImageNet-1K data.
            r  r  r  r  r  zFhttps://download.pytorch.org/models/regnet_y_16gf_lc_swag-f3ec0043.pth+https://github.com/pytorch/vision/pull/5793gX9vT@gV-OX@
                These weights are composed of the original frozen `SWAG <https://arxiv.org/abs/2201.08371>`_ trunk
                weights and a linear classifier learnt on top of them trained on ImageNet-1K data.
            r  r  r  r  r  r  NrL   rM   rN   r   r   r   r   r  r  r   BICUBIC_COMMON_SWAG_METAIMAGENET1K_SWAG_E2E_V1IMAGENET1K_SWAG_LINEAR_V1r  r   rK   rJ   r!   r!   }  s       GL7.#>>>

"j##     s
 
 
  M$ GL7.#3OOO

"P##     
 
 
  M, %WQ73CO`Oh
 
 


"##     
 
 
  , !(T73CO`Oh
 
 


C"##     
 
 
! ! !. GGGrK   r!   c                   v   e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          Z ed eedde	j
                  i eddddd	idddd          Z ed eedde	j
                  i edddd d!d	id
dd"d#          ZeZd$S )%r"   z>https://download.pytorch.org/models/regnet_y_32gf-4dee3f7a.pthr  r  i<r&  r  gx&18T@g(\W@r	  gp=
#@@gS㥛P@r
  r  r  z>https://download.pytorch.org/models/regnet_y_32gf-8db6d4b5.pthr  r  r  gd;OT@gZd;X@r  zChttps://download.pytorch.org/models/regnet_y_32gf_swag-04fdfa75.pthr'  r(  gʡU@gI+X@g/ݴW@r*  r+  zFhttps://download.pytorch.org/models/regnet_y_32gf_lc_swag-e1583746.pthr,  g+'U@gQ^X@r-  r.  Nr/  r   rK   rJ   r"   r"     s       GL7.#>>>

#j##    !s
 
 
  M$ GL7.#3OOO

#P##    !
 
 
  M, %WQ73CO`Oh
 
 


###    !
 
 
  , !(T73CO`Oh
 
 


C###    !
 
 
! ! !. GGGrK   r"   c                       e Zd Z ed eeddej                  i edddddid	d
dd          Z	 ed eeddej                  i eddddddidd
dd          Z
e	ZdS )r#   zDhttps://download.pytorch.org/models/regnet_y_128gf_swag-c8ce3e52.pthr'  r(  i^o&r  g;OV@gS㥫X@r	  gQiw@g㥛 ;@r*  r+  r  zGhttps://download.pytorch.org/models/regnet_y_128gf_lc_swag-cbe8ce12.pthr  r,  g1ZU@gtvX@gx&_@r-  r.  N)rL   rM   rN   r   r   r   r   r0  r1  r2  r3  r  r   rK   rJ   r#   r#   /  s       $WR73CO`Oh
 
 


###    "
 
 
  , !(U73CO`Oh
 
 


C###    "
 
 
! ! !. %GGGrK   r#   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r$   z?https://download.pytorch.org/models/regnet_x_400mf-adf1edd5.pthr  r  iS r  r  gL7A`5R@g̼V@r	  g"~?g5^IB5@r
  r  r  z?https://download.pytorch.org/models/regnet_x_400mf-62229a5f.pthr  r  Dhttps://github.com/pytorch/vision/issues/3995#new-recipe-with-fixresgKR@gS㥛W@goA5@r  Nr  r   rK   rJ   r$   r$   `          GM7.#>>>

!j##     s
 
 
  M$ GM7.#3OOO

!\##     
 
 
  M, GGGrK   r$   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r%   z?https://download.pytorch.org/models/regnet_x_800mf-ad17e45c.pthr  r  in r  r  g!rhR@gʡEW@r	  g?gR;@r
  r  r  z?https://download.pytorch.org/models/regnet_x_800mf-94a99ebd.pthr  r  r7  g rhaS@g/tW@r  Nr  r   rK   rJ   r%   r%     s        GM7.#>>>

!j##     s
 
 
  M$ GM7.#3OOO

!\##     
 
 
  M, GGGrK   r%   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r&   z?https://download.pytorch.org/models/regnet_x_1_6gf-e3633e7f.pthr  r  i: r  r  g(\BS@g\(\W@r	  gS?gZdA@r
  r  r  z?https://download.pytorch.org/models/regnet_x_1_6gf-a12f2b72.pthr  r  r7  gnS@g^IW@r  Nr  r   rK   rJ   r&   r&     r8  rK   r&   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r'   z?https://download.pytorch.org/models/regnet_x_3_2gf-f342aeae.pthr  r  i(h r!  r  gKS@gsh|W@r	  g"~j	@gT㥛`M@r
  r  r  z?https://download.pytorch.org/models/regnet_x_3_2gf-7071aa85.pthr  r  r  gCLT@gQW@r  Nr  r   rK   rJ   r'   r'     r"  rK   r'   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r(   z=https://download.pytorch.org/models/regnet_x_8gf-03ceed89.pthr  r  i[r!  r  gtS@gClW@r	  g{G@g;Ob@r
  r  r  z=https://download.pytorch.org/models/regnet_x_8gf-2b70d774.pthr  r  r  gSkT@gZdW@r  Nr  r   rK   rJ   r(   r(     r$  rK   r(   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r)   z>https://download.pytorch.org/models/regnet_x_16gf-2007eb11.pthr  r  i9<r!  r  gʡET@g#~jW@r	  go/@gMbi@r
  r  r  z>https://download.pytorch.org/models/regnet_x_16gf-ba3796d7.pthr  r  r  gҭT@gCX@r  Nr  r   rK   rJ   r)   r)   <  s        GL7.#>>>

"k##    !s
 
 
  M$ GL7.#3OOO

"P##    !
 
 
  M, GGGrK   r)   c                       e Zd Z ed eed          i edddddd	id
ddd          Z ed eedd          i edddddd	id
ddd          ZeZ	dS )r*   z>https://download.pytorch.org/models/regnet_x_32gf-9d47f8d0.pthr  r  imr&  r  g+'T@gZd;W@r	  g#~j?@gvy@r
  r  r  z>https://download.pytorch.org/models/regnet_x_32gf-6eb8fdc6.pthr  r  r  g7A`T@gOnX@r  Nr  r   rK   rJ   r*   r*   h  s        GL7.#>>>

#j##    !s
 
 
  M$ GL7.#3OOO

#P##    !
 
 
  M, GGGrK   r*   
pretrained)r   T)r   r   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_400MF_Weights
        :members:
       0   gp=
;@gQ @r         ?rx   r   r   r   rV   rX   r   )r   verifyr   r   r   r   r   r   paramss       rJ   r+   r+     sY    ( %++G44G)x4]^imxxqwxxF67H77777rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_800MF_Weights
        :members:
       8   gQkC@g333333@rA  rC  rD  r   )r   rE  r   r   r   rF  s       rJ   r,   r,     sY    ( %++G44G)x3\^imxxqwxxF67H77777rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights
        :members:
       rB  g(\µ4@g333333@   rC  rD  r   )r   rE  r   r   r   rF  s       rJ   r-   r-     d    ( %++G44G) be2 PV F 67H77777rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights
        :members:
       P   gq=
ףPE@gHzG@rM  rC  rD  r   )r   rE  r   r   r   rF  s       rJ   r.   r.     rN  rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_8GF_Weights
        :members:
          gGz4S@gQ@rJ  rC  rD  r   )r    rE  r   r   r   rF  s       rJ   r/   r/      sd    ( #))'22G) cu$B QW F 67H77777rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_16GF_Weights
        :members:
          gQZ@gףp=
@p   rC  rD  r   )r!   rE  r   r   r   rF  s       rJ   r0   r0     d    ( $**733G) cv4S4 SY F 67H77777rK   c           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )a  
    Constructs a RegNetY_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_32GF_Weights
        :members:
       r  g)\\@g=
ףp=@rC  rD  r   )r"   rE  r   r   r   rF  s       rJ   r1   r1   8  rY  rK   )r?  Nc           
          t                               |           } t          j        dddddddd|}t	          || |fi |S )	a  
    Constructs a RegNetY_128GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_Y_128GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_128GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_Y_128GF_Weights
        :members:
    rL  i  g(\d@g)\(@i  rC  rD  r   )r#   rE  r   r   r   rF  s       rJ   r2   r2   T  sd    ( %++G44G) cv4S4 SY F 67H77777rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_400MF_Weights
        :members:
       rM  g{Gz8@gRQ@rA  rx   r   r   r   rV   r   )r$   rE  r   r   r   rF  s       rJ   r3   r3   p  V    ( %++G44G)j4]_jjcijjF67H77777rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_800MF_Weights
        :members:
    rA  rJ  g=
ףpA@g=
ףp=@r_  r   )r%   rE  r   r   r   rF  s       rJ   r4   r4     r`  rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights
        :members:
    rV  rQ  gzGA@      @rM  r_  r   )r&   rE  r   r   r   rF  s       rJ   r5   r5     r`  rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights
        :members:
       X   g(\O:@rc  rB  r_  r   )r'   rE  r   r   r   rF  s       rJ   r6   r6     r`  rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_8GF_Weights
        :members:
       rQ  gHzH@g
ףp=
@x   r_  r   )r(   rE  r   r   r   rF  s       rJ   r7   r7     sV    ( #))'22G)k4]`kkdjkkF67H77777rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_16GF_Weights
        :members:
    r^     gQK@g @   r_  r   )r)   rE  r   r   r   rF  s       rJ   r8   r8     V    ( $**733G)kC]`kkdjkkF67H77777rK   c           	          t                               |           } t          j        ddddddd|}t	          || |fi |S )a  
    Constructs a RegNetX_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.

    Args:
        weights (:class:`~torchvision.models.RegNet_X_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.

    .. autoclass:: torchvision.models.RegNet_X_32GF_Weights
        :members:
    rh  i@  gףp=
wQ@r      r_  r   )r*   rE  r   r   r   rF  s       rJ   r9   r9     rm  rK   )Or   collectionsr   	functoolsr   typingr   r   r   r   r	   r
   r   r   r   ops.miscr   r   transforms._presetsr   r   utilsr   _apir   r   r   _metar   _utilsr   r   r   __all__r;   r   rU   rQ   rj   rw   r   r   boolr   r   str__annotations__r1  r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r  r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r   rK   rJ   <module>r}     s    # # # # # #       = = = = = = = = = = = = = = = =          > > > > > > > > H H H H H H H H ' ' ' ' ' ' 6 6 6 6 6 6 6 6 6 6 ' ' ' ' ' ' S S S S S S S S S S     F
 
 
 
 
' 
 
 
&! &! &! &! &!"- &! &! &!R(" (" (" (" (" (" (" ("V> > > > >r} > > >Dl. l. l. l. l. l. l. l.^X X X X XRY X X Xvk"  	
    & &   d38n   
8K   ) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) ); ) ) )XV V V V VK V V VrV V V V VK V V Vr.% .% .% .% .%[ .% .% .%b) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) )[ ) ) )X) ) ) ) ); ) ) )X) ) ) ) )K ) ) )X) ) ) ) )K ) ) )X ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 84 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 84 ,0D0R!STTT>BUY 8 8 8X&:; 8d 8eh 8ms 8 8 8 UT 84 ,0E0S!TUUU@DW[ 8 8 8h'<= 8PT 8gj 8ou 8 8 8 VU 84 ,0E0S!TUUU@DW[ 8 8 8h'<= 8PT 8gj 8ou 8 8 8 VU 84 !5666BFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 76 84 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0F0T!UVVVBFY] 8 8 8x(>? 8RV 8il 8qw 8 8 8 WV 80 ,0D0R!STTT>BUY 8 8 8X&:; 8d 8eh 8ms 8 8 8 UT 80 ,0E0S!TUUU@DW[ 8 8 8h'<= 8PT 8gj 8ou 8 8 8 VU 80 ,0E0S!TUUU@DW[ 8 8 8h'<= 8PT 8gj 8ou 8 8 8 VU 8 8 8rK   