
    N jG.                        S SK r S SKJrJrJrJrJrJrJrJ	r	  S SK
Jr  / SQr " S S\ R                  R                  5      r " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      r " S# S$\5      r " S% S&\5      r " S' S(\5      r g))    N)BatchNorm1dBatchNorm2dBatchNorm3dConv1dConv2dConv3dLinearReLU)type_before_parametrizations)
ConvReLU1d
ConvReLU2d
ConvReLU3d
LinearReLUConvBn1dConvBn2dConvBnReLU1dConvBnReLU2dConvBn3dConvBnReLU3dBNReLU2dBNReLU3d
LinearBn1dLinearLeakyReLU
LinearTanh	ConvAdd2dConvAddReLU2dc                       \ rS rSrSrg)_FusedModule&    N)__name__
__module____qualname____firstlineno____static_attributes__r        t/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/torch/ao/nn/intrinsic/modules/fused.pyr   r   &   s    r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   *   zThis is a sequential container which calls the Conv1d and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g N#Incorrect types for input modules: z and )r   r   r
   AssertionErrorr!   super__init__selfconvrelu	__class__s      r'   r/   ConvReLU1d.__init__.   f    (.&8,T2d: 5/5>>?u/5>>?A 
 	$r&   r    r!   r"   r#   r$   __doc__r/   r%   __classcell__r4   s   @r'   r   r   *       V
% 
%r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   ;   zThis is a sequential container which calls the Conv2d and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r
   r-   r!   r.   r/   r0   s      r'   r/   ConvReLU2d.__init__?   r6   r&   r    r7   r:   s   @r'   r   r   ;   r;   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   L   zThis is a sequential container which calls the Conv3d and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r
   r-   r!   r.   r/   r0   s      r'   r/   ConvReLU3d.__init__P   r6   r&   r    r7   r:   s   @r'   r   r   L   r;   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   ]   zThis is a sequential container which calls the Linear and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r	   r
   r-   r!   r.   r/   )r1   linearr3   r4   s      r'   r/   LinearReLU.__init__a   sf    (0F:,T2d: 5/7@@A/5>>?A 
 	&r&   r    r7   r:   s   @r'   r   r   ]   s    V
' 
'r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   n   zThis is a sequential container which calls the Conv 1d and Batch Norm 1d modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r   r-   r!   r.   r/   r1   r2   bnr4   s      r'   r/   ConvBn1d.__init__r   e    (.&8,R0K? 5/5>>?u/3<<=? 
 	"r&   r    r7   r:   s   @r'   r   r   n       V
# 
#r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Conv 2d and Batch Norm 2d modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r   r-   r!   r.   r/   rL   s      r'   r/   ConvBn2d.__init__   rO   r&   r    r7   r:   s   @r'   r   r      rP   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Conv 1d, Batch Norm 1d, and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c           
      2  > [        U5      [        :X  a&  [        U5      [        :X  a  [        U5      [        :X  dM  [	        S[        U5      R
                   S[        U5      R
                   S[        U5      R
                   35      e[        TU ]  XU5        g Nr,   z, z, and )r   r   r   r
   r-   r!   r.   r/   r1   r2   rM   r3   r4   s       r'   r/   ConvBnReLU1d.__init__       (.&8,R0K?,T2d: 5/5>>?r/3<<=V/5>>?A  	4(r&   r    r7   r:   s   @r'   r   r          V) )r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Conv 2d, Batch Norm 2d, and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c           
      2  > [        U5      [        :X  a&  [        U5      [        :X  a  [        U5      [        :X  dM  [	        S[        U5      R
                   S[        U5      R
                   S[        U5      R
                   35      e[        TU ]  XU5        g rX   )r   r   r   r
   r-   r!   r.   r/   rY   s       r'   r/   ConvBnReLU2d.__init__   r[   r&   r    r7   r:   s   @r'   r   r      r\   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Conv 3d and Batch Norm 3d modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r   r-   r!   r.   r/   rL   s      r'   r/   ConvBn3d.__init__   rO   r&   r    r7   r:   s   @r'   r   r      rP   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Conv 3d, Batch Norm 3d, and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c           
      2  > [        U5      [        :X  a&  [        U5      [        :X  a  [        U5      [        :X  dM  [	        S[        U5      R
                   S[        U5      R
                   S[        U5      R
                   35      e[        TU ]  XU5        g rX   )r   r   r   r
   r-   r!   r.   r/   rY   s       r'   r/   ConvBnReLU3d.__init__   r[   r&   r    r7   r:   s   @r'   r   r      r\   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the BatchNorm 2d and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r
   r-   r!   r.   r/   r1   
batch_normr3   r4   s      r'   r/   BNReLU2d.__init__   f    (4C,T2d: 5/
;DDEU/5>>?A 
 	*r&   r    r7   r:   s   @r'   r   r          V
+ 
+r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the BatchNorm 3d and ReLU modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r   r
   r-   r!   r.   r/   rl   s      r'   r/   BNReLU3d.__init__   ro   r&   r    r7   r:   s   @r'   r   r      rp   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r      zThis is a sequential container which calls the Linear and BatchNorm1d modules.
During quantization this will be replaced with the corresponding fused module.c                    > [        U5      [        :X  a  [        U5      [        :X  d7  [        S[        U5      R                   S[        U5      R                   35      e[
        TU ]  X5        g r+   )r   r	   r   r-   r!   r.   r/   )r1   rG   rM   r4   s      r'   r/   LinearBn1d.__init__   se    (0F:,R0K? 5/7@@A/3<<=? 
 	$r&   r    r7   r:   s   @r'   r   r      r;   r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   i  zThis is a sequential container which calls the Linear and LeakyReLU modules.
During quantization this will be replaced with the corresponding fused module.c                   > [        U5      [        L a&  [        U5      [        R                  R                  L d7  [        S[        U5      R                   S[        U5      R                   35      e[        TU ]!  X5        g r+   )	typer	   torchnn	LeakyReLUr-   r!   r.   r/   )r1   rG   
leaky_relur4   s      r'   r/   LinearLeakyReLU.__init__  sl    V&4
+;uxx?Q?Q+Q 5<(()tJ/?/H/H.IK  	,r&   r    r7   r:   s   @r'   r   r     s    V- -r&   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )r   i  zThis is a sequential container which calls the Linear and Tanh modules.
During quantization this will be replaced with the corresponding fused module.c                   > [        U5      [        L a&  [        U5      [        R                  R                  L d7  [        S[        U5      R                   S[        U5      R                   35      e[        TU ]!  X5        g r+   )	r{   r	   r|   r}   Tanhr-   r!   r.   r/   )r1   rG   tanhr4   s      r'   r/   LinearTanh.__init__  sh    V&4:+F 5<(()tDz/B/B.CE  	&r&   r    r7   r:   s   @r'   r   r     s    V' 'r&   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )r   i'  zThis is a sequential container which calls the Conv2d modules with extra Add.
During quantization this will be replaced with the corresponding fused module.c                 0   > [         TU ]  U5        X l        g N)r.   r/   add)r1   r2   r   r4   s      r'   r/   ConvAdd2d.__init__+  s    r&   c                 8    U R                  U S   " U5      U5      $ )z4Applies convolution to x1 and adds the result to x2.r   r   r1   x1x2s      r'   forwardConvAdd2d.forward/  s    xxQR((r&   r   	r!   r"   r#   r$   r8   r/   r   r%   r9   r:   s   @r'   r   r   '  s    V) )r&   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )r   i4  zThis is a sequential container which calls the Conv2d, add, Relu.
During quantization this will be replaced with the corresponding fused module.c                 <   > [         TU ]  U5        X l        X0l        g r   )r.   r/   r   r3   )r1   r2   r   r3   r4   s       r'   r/   ConvAddReLU2d.__init__8  s    	r&   c                 V    U R                  U R                  U S   " U5      U5      5      $ )zCApplies convolution to x1, adds the result to x2, and applies ReLU.r   )r3   r   r   s      r'   r   ConvAddReLU2d.forward=  s$    yy$q'"+r233r&   )r   r3   r   r:   s   @r'   r   r   4  s    V
4 4r&   r   )!r|   torch.nnr   r   r   r   r   r   r	   r
   torch.nn.utils.parametrizer   __all__r}   
Sequentialr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r&   r'   <module>r      s   	 	 	 D,	588&& 	% %"% %"% %"' '"#| #"#| #")< )&)< )&#| #")< )&+| +"+| +"% %"
-l 
-
' 
'
) 
)4L 4r&   