
    h;"                        S SK Jr  S SKJrJr  S SKrS SKJr  S SKJs  J	r	  SSK
Jr  SSKJr  SSKJrJrJr  SS	KJr  SS
KJrJr  / SQr " S S\R0                  5      r " S S\R0                  5      rS\S\\   S\S\S\4
S jr\SSS.r " S S\5      r " S S\5      r \" 5       \" S\RB                  4S9SSS .S\\   S\S\S\4S! jj5       5       r"\" 5       \" S\ RB                  4S9SSS .S\\    S\S\S\4S" jj5       5       r#g)#    )partial)AnyOptionalN   )ImageClassification)_log_api_usage_once   )register_modelWeightsWeightsEnum)_IMAGENET_CATEGORIES)_ovewrite_named_paramhandle_legacy_interface)
SqueezeNetSqueezeNet1_0_WeightsSqueezeNet1_1_Weightssqueezenet1_0squeezenet1_1c            
       z   ^  \ rS rSrS\S\S\S\SS4
U 4S jjrS	\R                  S\R                  4S
 jrSr	U =r
$ )Fire   inplanessqueeze_planesexpand1x1_planesexpand3x3_planesreturnNc                 b  > [         TU ]  5         Xl        [        R                  " XSS9U l        [        R                  " SS9U l        [        R                  " X#SS9U l        [        R                  " SS9U l	        [        R                  " X$SSS9U l
        [        R                  " SS9U l        g )Nr	   kernel_sizeTinplace   )r   padding)super__init__r   nnConv2dsqueezeReLUsqueeze_activation	expand1x1expand1x1_activation	expand3x3expand3x3_activation)selfr   r   r   r   	__class__s        U/var/www/auris/envauris/lib/python3.13/site-packages/torchvision/models/squeezenet.pyr%   Fire.__init__   s     yyqI"$''$"7>QRS$&GGD$9!>QR\]^$&GGD$9!    xc                     U R                  U R                  U5      5      n[        R                  " U R	                  U R                  U5      5      U R                  U R                  U5      5      /S5      $ Nr	   )r*   r(   torchcatr,   r+   r.   r-   r/   r4   s     r1   forwardFire.forward   sb    ##DLLO4yy&&t~~a'894;T;TUYUcUcdeUf;ghjk
 	
r3   )r+   r,   r-   r.   r   r(   r*   )__name__
__module____qualname____firstlineno__intr%   r7   Tensorr:   __static_attributes____classcell__r0   s   @r1   r   r      sM    : :c :S :dg :lp :
 
%,, 
 
r3   r   c            	       z   ^  \ rS rSrSS\S\S\SS4U 4S jjjrS\R                  S\R                  4S	 jr
S
rU =r$ )r   $   versionnum_classesdropoutr   Nc                 n  > [         TU ]  5         [        U 5        X l        US:X  a  [        R
                  " [        R                  " SSSSS9[        R                  " SS9[        R                  " SSSS	9[        SS
SS5      [        SS
SS5      [        SSSS5      [        R                  " SSSS	9[        SSSS5      [        SSSS5      [        SSSS5      [        SSSS5      [        R                  " SSSS	9[        SSSS5      5      U l
        GO US:X  a  [        R
                  " [        R                  " SSSSS9[        R                  " SS9[        R                  " SSSS	9[        SS
SS5      [        SS
SS5      [        R                  " SSSS	9[        SSSS5      [        SSSS5      [        R                  " SSSS	9[        SSSS5      [        SSSS5      [        SSSS5      [        SSSS5      5      U l
        O[        SU S35      e[        R                  " SU R                  SS9n[        R
                  " [        R                  " US9U[        R                  " SS9[        R                  " S5      5      U l        U R                  5        H  n[!        U[        R                  5      (       d  M$  XTL a!  ["        R$                  " UR&                  SSS9  O ["        R(                  " UR&                  5        UR*                  c  Mx  ["        R,                  " UR*                  S5        M     g )N1_0r"   `      r   )r   strideTr    )r   rN   	ceil_mode   @             0      i  i   1_1zUnsupported SqueezeNet version z: 1_0 or 1_1 expectedr	   r   )p)r	   r	   g        g{Gz?)meanstdr   )r$   r%   r   rH   r&   
Sequentialr'   r)   	MaxPool2dr   features
ValueErrorDropoutAdaptiveAvgPool2d
classifiermodules
isinstanceinitnormal_weightkaiming_uniform_bias	constant_)r/   rG   rH   rI   
final_convmr0   s         r1   r%   SqueezeNet.__init__%   s   D!&eMM		!RQq9%1ERR$S"b"%S"c3'1ES"c3'S"c3'S"c3'S"c3'1ES"c3'DM MM		!RQq9%1ERR$S"b"%1ES"c3'S"c3'1ES"c3'S"c3'S"c3'S"c3'DM& >wiG\]^^ YYsD$4$4!D
--JJ!:rwwt/DbFZFZ[aFb
 A!RYY''?LL>))!((366%NN1661-  r3   r4   c                 t    U R                  U5      nU R                  U5      n[        R                  " US5      $ r6   )r]   ra   r7   flattenr9   s     r1   r:   SqueezeNet.forward^   s/    MM!OOA}}Q""r3   )ra   r]   rH   )rK   i  g      ?)r<   r=   r>   r?   strr@   floatr%   r7   rA   r:   rB   rC   rD   s   @r1   r   r   $   sK    7. 7.# 7.u 7._c 7. 7.r# #%,, # #r3   r   rG   weightsprogresskwargsr   c                     Ub#  [        US[        UR                  S   5      5        [        U 40 UD6nUb  UR	                  UR                  USS95        U$ )NrH   
categoriesT)rs   
check_hash)r   lenmetar   load_state_dictget_state_dict)rG   rr   rs   rt   models        r1   _squeezenetr}   d   s]     fmSl9S5TUw)&)Eg44hSW4XYLr3   z@https://github.com/pytorch/vision/pull/49#issuecomment-277560717zXThese weights reproduce closely the results of the paper using a simple training recipe.)rv   recipe_docsc                   P    \ rS rSr\" S\" \SS90 \ESSSSS	S
.0SSS.ES9r\r	Sr
g)r   |   z>https://download.pytorch.org/models/squeezenet1_0-b66bff10.pth   	crop_size)   r   i ImageNet-1KgM@g{GT@zacc@1zacc@5gh|?5?g&1@min_size
num_params_metrics_ops
_file_sizeurl
transformsry    Nr<   r=   r>   r?   r   r   r   _COMMON_METAIMAGENET1K_V1DEFAULTrB   r   r3   r1   r   r   |   T    L.#>

 !##  
M" Gr3   r   c                   P    \ rS rSr\" S\" \SS90 \ESSSSS	S
.0SSS.ES9r\r	Sr
g)r      z>https://download.pytorch.org/models/squeezenet1_1-b8a52dc0.pthr   r   )   r   i( r   gX9M@g-'T@r   gtV?g"~@r   r   r   Nr   r   r3   r1   r   r      r   r3   r   
pretrained)rr   T)rr   rs   c                 F    [         R                  U 5      n [        SX40 UD6$ )a  SqueezeNet model architecture from the `SqueezeNet: AlexNet-level
accuracy with 50x fewer parameters and <0.5MB model size
<https://arxiv.org/abs/1602.07360>`_ paper.

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

.. autoclass:: torchvision.models.SqueezeNet1_0_Weights
    :members:
rK   )r   verifyr}   rr   rs   rt   s      r1   r   r      s&    2 $**73Gug:6::r3   c                 F    [         R                  U 5      n [        SX40 UD6$ )a  SqueezeNet 1.1 model from the `official SqueezeNet repo
<https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_.

SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters
than SqueezeNet 1.0, without sacrificing accuracy.

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

.. autoclass:: torchvision.models.SqueezeNet1_1_Weights
    :members:
rW   )r   r   r}   r   s      r1   r   r      s&    6 $**73Gug:6::r3   )$	functoolsr   typingr   r   r7   torch.nnr&   torch.nn.initrd   transforms._presetsr   utilsr   _apir
   r   r   _metar   _utilsr   r   __all__Moduler   r   rp   boolr}   r   r   r   r   r   r   r   r3   r1   <module>r      sl          5 ' 6 6 ' B m
299 
$=# =#@k"  	
 $ 'PkK *K * ,0E0S0S!TU26;./;BF;Y\;; V ;6 ,0E0S0S!TU26;./;BF;Y\;; V ;r3   