
    9i                     ^    S SK Jr  S SKJr   " S S\5      r " S S\5      r " S S\5      rg)	    N)	LayerBasec                   :   ^  \ rS rSrU 4S jrS rS rS rSrU =r	$ )RectifiedLinear   c                 j   > [         [        U ]  5         Xl        [        R
                  " 5       U l        g N)superr   __init__dimnnReLUreluself	input_dim
output_dim	__class__s      n/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/modelscope/models/audio/ans/layers/activations.pyr
   RectifiedLinear.__init__
   s"    ot-/GGI	    c                 $    U R                  U5      $ r   )r   r   inputs     r   forwardRectifiedLinear.forward   s    yyr   c                 F    SnUSU R                   U R                   4-  -  nU$ )N z<RectifiedLinear> %d %d
r   r   re_strs     r   to_kaldi_nnetRectifiedLinear.to_kaldi_nnet   s)    -4880DDDr   c                     U$ r    r   instrs     r   load_kaldi_nnetRectifiedLinear.load_kaldi_nnet       r   )r   r   
__name__
__module____qualname____firstlineno__r
   r   r!   r'   __static_attributes____classcell__r   s   @r   r   r      s    
 
 r   r   c                   :   ^  \ rS rSrU 4S jrS rS rS rSrU =r	$ )
LogSoftmax   c                 j   > [         [        U ]  5         Xl        [        R                  " 5       U l        g r   )r	   r3   r
   r   r   lsr   s      r   r
   LogSoftmax.__init__   s"    j$(*--/r   c                 $    U R                  U5      $ r   )r6   r   s     r   r   LogSoftmax.forward"   s    wwu~r   c                 F    SnUSU R                   U R                   4-  -  nU$ )Nr   z<Softmax> %d %d
r   r   s     r   r!   LogSoftmax.to_kaldi_nnet%   )    %488(<<<r   c                     U$ r   r$   r%   s     r   r'   LogSoftmax.load_kaldi_nnet*   r)   r   )r   r6   r*   r1   s   @r   r3   r3      s    "

 r   r3   c                   :   ^  \ rS rSrU 4S jrS rS rS rSrU =r	$ )Sigmoid.   c                 j   > [         [        U ]  5         Xl        [        R                  " 5       U l        g r   )r	   r@   r
   r   r   sigr   s      r   r
   Sigmoid.__init__0   s"    gt%'::<r   c                 $    U R                  U5      $ r   )rC   r   s     r   r   Sigmoid.forward5   s    xxr   c                 F    SnUSU R                   U R                   4-  -  nU$ )Nr   z<Sigmoid> %d %d
r   r   s     r   r!   Sigmoid.to_kaldi_nnet8   r<   r   c                     U$ r   r$   r%   s     r   r'   Sigmoid.load_kaldi_nnet=   r)   r   )r   rC   r*   r1   s   @r   r@   r@   .   s     

 r   r@   )torch.nnr   -modelscope.models.audio.ans.layers.layer_baser   r   r3   r@   r$   r   r   <module>rM      s1     Ci & &i r   