Ë
    [^(hW5  ã                   óà  — d dl mZ d dlmZ d dlZd dlmc mZ d dlmZ  G d„ de«      Z	 G d„ dej                  «      Zd	ej                  d
ej                  defd„Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Z G d„ d ej                  «      Z G d!„ d"ej                  «      Z G d#„ d$ej                  «      Z G d%„ d&ej                  «      Zy)'é    )ÚAny)ÚBaseSparsifierN)Únnc                   óh   ‡ — e Zd Zdeeef   ddfˆ fd„Zdej                  dedeeef   ddfd„Z	ˆ xZ
S )ÚImplementedSparsifierÚkwargsÚreturnNc                 ó&   •— t         ‰| �  |¬«       y )N)Údefaults)ÚsuperÚ__init__)Úselfr   Ú	__class__s     €úd/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/testing/_internal/common_pruning.pyr   zImplementedSparsifier.__init__
   s   ø€ Ü‰Ñ &ÐÕ)ó    ÚmoduleÚtensor_namec                 óž   — d|j                   j                  d   j                  d<   | j                  d   }|j	                  dd«      dz   |d<   y )Nr   zlinear1.weightÚ
step_counté   )ÚparametrizationsÚweightÚmaskÚstateÚget)r   r   r   r   Úlinear_states        r   Úupdate_maskz!ImplementedSparsifier.update_mask   sN   € Ø45ˆ×Ñ×&Ñ& qÑ)×.Ñ.¨qÑ1Ø—z‘zÐ"2Ñ3ˆØ%1×%5Ñ%5°lÀAÓ%FÈÑ%Jˆ�\Ò"r   )Ú__name__Ú
__module__Ú__qualname__ÚdictÚstrr   r   r   ÚModuler   Ú__classcell__©r   s   @r   r   r   	   sR   ø„ ð*  c¨3 h¡ð *°Dõ *ðK "§)¡)ð K¸#ð KÈÈcÐSVÈhÉð KÐ\`÷ Kr   r   c                   ó>   — e Zd ZdZedej                  dd fd„«       Zy)ÚMockSparseLinearzË
    This class is a MockSparseLinear class to check convert functionality.
    It is the same as a normal Linear layer, except with a different type, as
    well as an additional from_dense method.
    Úmodr	   c                 ó@   —  | |j                   |j                  «      }|S )z	
        )Úin_featuresÚout_features)Úclsr(   Úlinears      r   Ú
from_densezMockSparseLinear.from_dense   s"   € ñ �S—_‘_Ø×%Ñ%ó'ˆàˆr   N)r   r   r    Ú__doc__Úclassmethodr   ÚLinearr.   © r   r   r'   r'      s.   „ ñð
 ð˜RŸY™Yð Ð+=ò ó ñr   r'   Úsubset_tensorÚsuperset_tensorr	   c                 ó’   — d}| D ]@  }|t        |«      k  r/t        j                  |||   «      s|dz  }nŒ1|t        |«      k  rŒ/ y y)zW
    Checks to see if all rows in subset tensor are present in the superset tensor
    r   r   FT)ÚlenÚtorchÚequal)r3   r4   ÚiÚrows       r   Úrows_are_subsetr;   "   s]   € ð 	
€AØò ˆØ”#�oÓ&Ò&Ü—;‘;˜s O°AÑ$6Ô7Ø�Q‘‘àð	 ”#�oÓ&Ó&ñ ðð r   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚSimpleLinearzžModel with only Linear layers without biases, some wrapped in a Sequential,
    some following the Sequential. Used to test basic pruned Linear-Linear fusion.r	   c           	      óR  •— t         ‰| �  «        t        j                  t        j                  ddd¬«      t        j                  ddd¬«      t        j                  ddd¬«      «      | _        t        j                  ddd¬«      | _        t        j                  ddd¬«      | _        y )Né   é   F©Úbiasé   é   é
   )r   r   r   Ú
Sequentialr1   ÚseqÚlinear1Úlinear2©r   r   s    €r   r   zSimpleLinear.__init__6   sx   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜ Ô'Ü�I‰I�a˜ Ô'Ü�I‰I�a˜ Ô'ó
ˆŒô
 —y‘y  A¨EÔ2ˆŒÜ—y‘y  B¨UÔ3ˆ�r   Úxc                 ól   — | j                  |«      }| j                  |«      }| j                  |«      }|S ©N)rG   rH   rI   ©r   rK   s     r   ÚforwardzSimpleLinear.forward@   ó.   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆØ�L‰L˜‹OˆØˆr   ©r	   N©	r   r   r    r/   r   r7   ÚTensorrO   r$   r%   s   @r   r=   r=   2   s)   ø„ ñVõ4ð˜Ÿ™ð ¨%¯,©,÷ r   r=   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )Ú
LinearBiaszŠModel with only Linear layers, alternating layers with biases,
    wrapped in a Sequential. Used to test pruned Linear-Bias-Linear fusion.r	   c                 ó:  •— t         ‰| �  «        t        j                  t        j                  ddd¬«      t        j                  ddd¬«      t        j                  ddd¬«      t        j                  ddd¬«      t        j                  ddd¬«      «      | _        y )	Nr?   r@   TrA   rC   Fé   rE   )r   r   r   rF   r1   rG   rJ   s    €r   r   zLinearBias.__init__K   sn   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜ Ô&Ü�I‰I�a˜ Ô'Ü�I‰I�a˜ Ô&Ü�I‰I�a˜ Ô&Ü�I‰I�a˜ %Ô(ó
ˆ�r   rK   c                 ó(   — | j                  |«      }|S rM   )rG   rN   s     r   rO   zLinearBias.forwardU   s   € Ø�H‰H�Q‹KˆØˆr   rQ   rR   r%   s   @r   rU   rU   G   s)   ø„ ñOõ
ð˜Ÿ™ð ¨%¯,©,÷ r   rU   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚLinearActivationzùModel with only Linear layers, some with bias, some in a Sequential and some following.
    Activation functions modules in between each Linear in the Sequential, and each outside layer.
    Used to test pruned Linear(Bias)-Activation-Linear fusion.r	   c                 ó  •— t         ‰| �  «        t        j                  t        j                  ddd¬«      t        j
                  «       t        j                  ddd¬«      t        j                  «       t        j                  ddd¬«      «      | _        t        j                  ddd¬«      | _        t        j
                  «       | _	        t        j                  dd	d¬«      | _
        t        j                  «       | _        y )
Nr?   r@   TrA   rC   FrD   rW   rE   )r   r   r   rF   r1   ÚReLUÚTanhrG   rH   Úact1rI   Úact2rJ   s    €r   r   zLinearActivation.__init___   s¤   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜ Ô&Ü�G‰G‹IÜ�I‰I�a˜ Ô'Ü�G‰G‹IÜ�I‰I�a˜ Ô&ó
ˆŒô —y‘y  A¨DÔ1ˆŒÜ—G‘G“IˆŒ	Ü—y‘y  B¨UÔ3ˆŒÜ—G‘G“Iˆ�	r   rK   c                 ó°   — | j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }|S rM   )rG   rH   r^   rI   r_   rN   s     r   rO   zLinearActivation.forwardm   óH   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆØ�I‰I�a‹LˆØ�L‰L˜‹OˆØ�I‰I�a‹LˆØˆr   rQ   rR   r%   s   @r   rZ   rZ   Z   s)   ø„ ñBõð˜Ÿ™ð ¨%¯,©,÷ r   rZ   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚLinearActivationFunctionala,  Model with only Linear layers, some with bias, some in a Sequential and some following.
    Activation functions modules in between each Linear in the Sequential, and functional
    activationals are called in between each outside layer.
    Used to test pruned Linear(Bias)-Activation-Linear fusion.r	   c                 ó
  •— t         ‰| �  «        t        j                  t        j                  ddd¬«      t        j
                  «       t        j                  ddd¬«      t        j
                  «       t        j                  ddd¬«      «      | _        t        j                  ddd¬«      | _        t        j                  dd	d¬«      | _        t        j                  d	d
d¬«      | _	        t        j
                  «       | _
        y )Nr?   r@   TrA   rC   FrD   rW   é   rE   )r   r   r   rF   r1   r\   rG   rH   rI   Úlinear3r^   rJ   s    €r   r   z#LinearActivationFunctional.__init__|   s«   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜ Ô&Ü�G‰G‹IÜ�I‰I�a˜ Ô'Ü�G‰G‹IÜ�I‰I�a˜ Ô&ó
ˆŒô —y‘y  A¨DÔ1ˆŒÜ—y‘y  A¨EÔ2ˆŒÜ—y‘y  B¨UÔ3ˆŒÜ—G‘G“Iˆ�	r   rK   c                 ó  — | j                  |«      }| j                  |«      }t        j                  |«      }| j	                  |«      }t        j                  |«      }| j                  |«      }t        j                  |«      }|S rM   )rG   rH   ÚFÚrelurI   rf   rN   s     r   rO   z"LinearActivationFunctional.forwardŠ   sb   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆÜ�F‰F�1‹IˆØ�L‰L˜‹OˆÜ�F‰F�1‹IˆØ�L‰L˜‹OˆÜ�F‰F�1‹IˆØˆr   rQ   rR   r%   s   @r   rc   rc   v   s)   ø„ ñBõ
ð˜Ÿ™ð ¨%¯,©,÷ r   rc   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚSimpleConv2dz‡Model with only Conv2d layers, all without bias, some in a Sequential and some following.
    Used to test pruned Conv2d-Conv2d fusion.r	   c           
      ó4  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j                  ddddd¬«      «      | _        t        j                  ddddd¬«      | _        t        j                  ddddd¬«      | _        y )	Nr   é    rW   FrA   é@   é0   é4   ©r   r   r   rF   ÚConv2drG   Úconv2d1Úconv2d2rJ   s    €r   r   zSimpleConv2d.__init__™   sx   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜˜Q ¨Ô.Ü�I‰I�b˜"˜a ¨Ô/ó
ˆŒô —y‘y  R¨¨A°EÔ:ˆŒÜ—y‘y  R¨¨A°EÔ:ˆ�r   rK   c                 ól   — | j                  |«      }| j                  |«      }| j                  |«      }|S rM   ©rG   rs   rt   rN   s     r   rO   zSimpleConv2d.forward¢   rP   r   rQ   rR   r%   s   @r   rk   rk   •   s(   ø„ ñ1õ;ð˜Ÿ™ð ¨%¯,©,÷ r   rk   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )Ú
Conv2dBiaszˆModel with only Conv2d layers, some with bias, some in a Sequential and some outside.
    Used to test pruned Conv2d-Bias-Conv2d fusion.r	   c                 óf  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j                  ddddd¬«      t        j                  ddddd¬«      «      | _        t        j                  ddddd¬«      | _        t        j                  dd	ddd¬«      | _        y ©
Nr   rm   rW   TrA   rn   Fro   rp   rq   rJ   s    €r   r   zConv2dBias.__init__­   sŒ   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜˜Q ¨Ô-Ü�I‰I�b˜"˜a ¨Ô.Ü�I‰I�b˜"˜a ¨Ô/ó
ˆŒô
 —y‘y  R¨¨A°DÔ9ˆŒÜ—y‘y  R¨¨A°EÔ:ˆ�r   rK   c                 ól   — | j                  |«      }| j                  |«      }| j                  |«      }|S rM   rv   rN   s     r   rO   zConv2dBias.forward·   rP   r   rQ   rR   r%   s   @r   rx   rx   ©   s(   ø„ ñ6õ;ð˜Ÿ™ð ¨%¯,©,÷ r   rx   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚConv2dActivationa  Model with only Conv2d layers, some with bias, some in a Sequential and some following.
    Activation function modules in between each Sequential layer, functional activations called
    in-between each outside layer.
    Used to test pruned Conv2d-Bias-Activation-Conv2d fusion.r	   c                 óØ  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j
                  «       t        j                  ddddd¬«      t        j                  «       t        j                  ddddd¬«      t        j
                  «       «      | _        t        j                  ddddd¬«      | _        t        j                  dd	ddd¬«      | _	        y rz   )
r   r   r   rF   rr   r\   r]   rG   rs   rt   rJ   s    €r   r   zConv2dActivation.__init__Ä   s§   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜˜Q ¨Ô-Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨Ô.Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨Ô/Ü�G‰G‹Ió
ˆŒô —y‘y  R¨¨A°EÔ:ˆŒÜ—y‘y  R¨¨A°DÔ9ˆ�r   rK   c                 óÀ   — | j                  |«      }| j                  |«      }t        j                  |«      }| j	                  |«      }t        j
                  |«      }|S rM   )rG   rs   rh   ri   rt   ÚhardtanhrN   s     r   rO   zConv2dActivation.forwardÑ   sH   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆÜ�F‰F�1‹IˆØ�L‰L˜‹OˆÜ�J‰J�q‹MˆØˆr   rQ   rR   r%   s   @r   r}   r}   ¾   s)   ø„ ñAõ
:ð˜Ÿ™ð ¨%¯,©,÷ r   r}   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚConv2dPadBiasaQ  Model with only Conv2d layers, all with bias and some with padding > 0,
    some in a Sequential and some following. Activation function modules in between each layer.
    Used to test that bias is propagated correctly in the special case of
    pruned Conv2d-Bias-(Activation)Conv2d fusion, when the second Conv2d layer has padding > 0.r	   c                 óö  •— t         ‰| �  «        t        j                  t        j                  dddddd¬«      t        j
                  «       t        j                  ddddd¬«      t        j
                  «       t        j                  dddddd¬«      t        j
                  «       t        j                  dddddd¬«      t        j
                  «       t        j                  ddddd¬«      t        j                  «       «
      | _        t        j                  dd	dddd¬«      | _        t        j
                  «       | _	        t        j                  d	d
dddd¬«      | _
        t        j                  «       | _        y )Nr   rm   rW   T)ÚpaddingrB   FrA   rn   ro   rp   )r   r   r   rF   rr   r\   r]   rG   rs   r^   rt   r_   rJ   s    €r   r   zConv2dPadBias.__init__à   s  ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜˜Q ¨1°4Ô8Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨Ô/Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨A°DÔ9Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨A°DÔ9Ü�G‰G‹IÜ�I‰I�b˜"˜a ¨Ô.Ü�G‰G‹Ió
ˆŒô —y‘y  R¨¨A°q¸tÔDˆŒÜ—G‘G“IˆŒ	Ü—y‘y  R¨¨A°q¸tÔDˆŒÜ—G‘G“Iˆ�	r   rK   c                 ó°   — | j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }|S rM   )rG   rs   r^   rt   r_   rN   s     r   rO   zConv2dPadBias.forwardó   ra   r   rQ   rR   r%   s   @r   r‚   r‚   Ú   s)   ø„ ñcõ
ð&˜Ÿ™ð ¨%¯,©,÷ r   r‚   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )Ú
Conv2dPoolzèModel with only Conv2d layers, all with bias, some in a Sequential and some following.
    Activation function modules in between each layer, Pool2d modules in between each layer.
    Used to test pruned Conv2d-Pool2d-Conv2d fusion.r	   c                 ó†  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j
                  ddd¬«      t        j                  «       t        j                  ddddd¬«      t        j                  «       t        j                  ddd¬«      «      | _	        t        j                  dd	ddd¬«      | _
        t        j
                  ddd¬«      | _        t        j                  «       | _        t        j                  d	d
ddd¬«      | _        t        j                  d
d
ddd¬«      | _        y )Nr   rm   rW   T©Úkernel_sizer„   rB   é   ©rŠ   Ústrider„   rn   ro   rp   )r   r   r   rF   rr   Ú	MaxPool2dr\   r]   Ú	AvgPool2drG   rs   ÚmaxpoolÚaf1rt   Úconv2d3rJ   s    €r   r   zConv2dPool.__init__  sã   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜¨°A¸DÔAÜ�L‰L Q¨q¸!Ô<Ü�G‰G‹IÜ�I‰I�b˜"¨!°Q¸TÔBÜ�G‰G‹IÜ�L‰L Q¨q¸!Ô<ó
ˆŒô —y‘y  R°QÀÈÔMˆŒÜ—|‘|°¸!ÀQÔGˆŒÜ—7‘7“9ˆŒÜ—y‘y  R°QÀÈÔMˆŒÜ—y‘y  R°QÀÈÔMˆ�r   rK   c                 ó.  — | j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j	                  |«      }t        j                  |ddd¬«      }t        j                  |«      }| j                  |«      }|S ©Nr‹   r   rŒ   )	rG   rs   r�   r‘   rt   rh   Ú
avg_pool2dri   r’   rN   s     r   rO   zConv2dPool.forward  sv   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆØ�L‰L˜‹OˆØ�H‰H�Q‹KˆØ�L‰L˜‹OˆÜ�L‰L˜¨°!¸QÔ?ˆÜ�F‰F�1‹IˆØ�L‰L˜‹OˆØˆr   rQ   rR   r%   s   @r   r‡   r‡   ü   s)   ø„ ñ8õNð 	˜Ÿ™ð 	¨%¯,©,÷ 	r   r‡   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚConv2dPoolFlattenFunctionala  Model with Conv2d layers, all with bias, some in a Sequential and some following, and then a Pool2d
    and a functional Flatten followed by a Linear layer.
    Activation functions and Pool2ds in between each layer also.
    Used to test pruned Conv2d-Pool2d-Flatten-Linear fusion.r	   c                 ó|  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j
                  ddd¬«      t        j                  «       t        j                  ddddd¬«      t        j                  «       t        j                  ddd¬«      «      | _	        t        j                  ddddd¬«      | _
        t        j                  «       | _        t        j                  dd	ddd¬«      | _        t        j                  d
«      | _        t        j                  d	dd¬«      | _        y )Nr   rW   Tr‰   r‹   rŒ   r@   r?   é   )r   r   é   rA   )r   r   r   rF   rr   rŽ   r\   r]   r�   rG   rs   r‘   rt   ÚAdaptiveAvgPool2dÚavg_poolr1   ÚfcrJ   s    €r   r   z$Conv2dPoolFlattenFunctional.__init__#  sÝ   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜¨°1¸4Ô@Ü�L‰L Q¨q¸!Ô<Ü�G‰G‹IÜ�I‰I�a˜¨°1¸4Ô@Ü�G‰G‹IÜ�L‰L Q¨q¸!Ô<ó
ˆŒô —y‘y  A°1¸aÀdÔKˆŒÜ—7‘7“9ˆŒÜ—y‘y  B°A¸qÀtÔLˆŒÜ×,Ñ,¨VÓ4ˆŒÜ—)‘)˜B ¨Ô.ˆ�r   rK   c                 ó0  — | j                  |«      }| j                  |«      }t        j                  |ddd¬«      }| j	                  |«      }| j                  |«      }| j                  |«      }t        j                  |d«      }| j                  |«      }|S r”   )
rG   rs   rh   Ú
max_pool2dr‘   rt   rœ   r7   Úflattenr�   rN   s     r   rO   z#Conv2dPoolFlattenFunctional.forward3  sz   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆÜ�L‰L˜¨°!¸QÔ?ˆØ�H‰H�Q‹KˆØ�L‰L˜‹OˆØ�M‰M˜!ÓˆÜ�M‰M˜!˜QÓˆØ�G‰G�A‹JˆØˆr   rQ   rR   r%   s   @r   r—   r—     s)   ø„ ñ@õ
/ð 	˜Ÿ™ð 	¨%¯,©,÷ 	r   r—   c                   ó\   ‡ — e Zd ZdZdˆ fd„Zdej                  dej                  fd„Zˆ xZS )ÚConv2dPoolFlattena  Model with Conv2d layers, all with bias, some in a Sequential and some following, and then a Pool2d
    and a Flatten module followed by a Linear layer.
    Activation functions and Pool2ds in between each layer also.
    Used to test pruned Conv2d-Pool2d-Flatten-Linear fusion.r	   c                 ó®  •— t         ‰| �  «        t        j                  t        j                  ddddd¬«      t        j
                  ddd¬«      t        j                  «       t        j                  ddddd¬«      t        j                  «       t        j                  ddd¬«      «      | _	        t        j                  ddddd¬«      | _
        t        j                  «       | _        t        j                  dd	ddd¬«      | _        t        j                  d
«      | _        t        j                  «       | _        t        j"                  ddd¬«      | _        y )Nr   rW   Tr‰   r‹   rŒ   r@   r?   r™   )r‹   r‹   é,   rš   rA   )r   r   r   rF   rr   rŽ   r\   r]   r�   rG   rs   r‘   rt   r›   rœ   ÚFlattenr    r1   r�   rJ   s    €r   r   zConv2dPoolFlatten.__init__E  sê   ø€ Ü‰ÑÔÜ—=‘=Ü�I‰I�a˜¨°1¸4Ô@Ü�L‰L Q¨q¸!Ô<Ü�G‰G‹IÜ�I‰I�a˜¨°1¸4Ô@Ü�G‰G‹IÜ�L‰L Q¨q¸!Ô<ó
ˆŒô —y‘y  A°1¸aÀdÔKˆŒÜ—7‘7“9ˆŒÜ—y‘y  B°A¸qÀtÔLˆŒÜ×,Ñ,¨VÓ4ˆŒÜ—z‘z“|ˆŒÜ—)‘)˜B ¨Ô.ˆ�r   rK   c                 ó&  — | j                  |«      }| j                  |«      }t        j                  |ddd¬«      }| j	                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }| j                  |«      }|S r”   )	rG   rs   rh   rŸ   r‘   rt   rœ   r    r�   rN   s     r   rO   zConv2dPoolFlatten.forwardV  sw   € Ø�H‰H�Q‹KˆØ�L‰L˜‹OˆÜ�L‰L˜¨°!¸QÔ?ˆØ�H‰H�Q‹KˆØ�L‰L˜‹OˆØ�M‰M˜!ÓˆØ�L‰L˜‹OˆØ�G‰G�A‹JˆØˆr   rQ   rR   r%   s   @r   r¢   r¢   ?  s)   ø„ ñ@õ
/ð"	˜Ÿ™ð 	¨%¯,©,÷ 	r   r¢   c            
       óŽ   ‡ — e Zd ZdZdededededdf
ˆ fd„Zd	ej                  deej                  ej                  f   fd
„Z	ˆ xZ
S )ÚLSTMLinearModelzCContainer module with an encoder, a recurrent module, and a linear.Ú	input_dimÚ
hidden_dimÚ
output_dimÚ
num_layersr	   Nc                 ó�   •— t         ‰| �  «        t        j                  |||«      | _        t        j
                  ||«      | _        y rM   )r   r   r   ÚLSTMÚlstmr1   r-   ©r   r©   rª   r«   r¬   r   s        €r   r   zLSTMLinearModel.__init__e  s6   ø€ ô 	‰ÑÔÜ—G‘G˜I z°:Ó>ˆŒ	Ü—i‘i 
¨JÓ7ˆ�r   Úinputc                 óT   — | j                  |«      \  }}| j                  |«      }||fS rM   )r¯   r-   )r   r±   ÚoutputÚ_hiddenÚdecodeds        r   rO   zLSTMLinearModel.forwardl  s,   € ØŸ)™) EÓ*‰ˆ�Ø—+‘+˜fÓ%ˆØ˜ˆÐr   ©r   r   r    r/   Úintr   r7   rS   ÚtuplerO   r$   r%   s   @r   r¨   r¨   b  s\   ø„ ÙMð8Øð8Ø*-ð8Ø;>ð8ØLOð8à	õ8ð˜UŸ\™\ð ¨e°E·L±LÀ%Ç,Á,Ð4NÑ.O÷ r   r¨   c            
       óŽ   ‡ — e Zd ZdZdededededdf
ˆ fd„Zd	ej                  deej                  ej                  f   fd
„Z	ˆ xZ
S )ÚLSTMLayerNormLinearModelz9Container module with an LSTM, a LayerNorm, and a linear.r©   rª   r«   r¬   r	   Nc                 óÄ   •— t         ‰| �  «        t        j                  |||«      | _        t        j
                  |«      | _        t        j                  ||«      | _        y rM   )	r   r   r   r®   r¯   Ú	LayerNormÚnormr1   r-   r°   s        €r   r   z!LSTMLayerNormLinearModel.__init__u  sF   ø€ ô 	‰ÑÔÜ—G‘G˜I z°:Ó>ˆŒ	Ü—L‘L Ó,ˆŒ	Ü—i‘i 
¨JÓ7ˆ�r   rK   c                 óv   — | j                  |«      \  }}| j                  |«      }| j                  |«      }||fS rM   )r¯   r½   r-   )r   rK   r   s      r   rO   z LSTMLayerNormLinearModel.forward}  s6   € Ø—9‘9˜Q“<‰ˆˆ5Ø�I‰I�a‹LˆØ�K‰K˜‹NˆØ�%ˆxˆr   r¶   r%   s   @r   rº   rº   r  s\   ø„ ÙCð8Øð8Ø*-ð8Ø;>ð8ØLOð8à	õ8ð˜Ÿ™ð ¨%°·±¸e¿l¹lÐ0JÑ*K÷ r   rº   )Útypingr   Útorch.ao.pruningr   r7   Útorch.nn.functionalr   Ú
functionalrh   r   r1   r'   rS   Úboolr;   r#   r=   rU   rZ   rc   rk   rx   r}   r‚   r‡   r—   r¢   r¨   rº   r2   r   r   ú<module>rÄ      s.  ðõ Ý +Û ß Ð Ý ôK˜Nô Kô�r—y‘yô ð 5§<¡<ð À%Ç,Á,ð ÐSWó ô �2—9‘9ô ô*�—‘ô ô&�r—y‘yô ô8 §¡ô ô>�2—9‘9ô ô(�—‘ô ô*�r—y‘yô ô8�B—I‘Iô ôD�—‘ô ôB "§)¡)ô ôD ˜Ÿ	™	ô  ôF�b—i‘iô ô ˜rŸy™yõ r   