o
    æS™i  ã                   @   s&   d Z ddlmZ G dd„ dejƒZdS )zLSTM layers module.é    )Únnc                       s8   e Zd ZdZddededef‡ fdd„Zd	d
„ Z‡  ZS )ÚSLSTMz~
    LSTM without worrying about the hidden state, nor the layout of the data.
    Expects input as convolutional layout.
    é   TÚ	dimensionÚ
num_layersÚskipc                    s$   t ƒ  ¡  || _t |||¡| _d S )N)ÚsuperÚ__init__r   r   ÚLSTMÚlstm)Úselfr   r   r   ©Ú	__class__© úH/home/ubuntu/.local/lib/python3.10/site-packages/encodec/modules/lstm.pyr	      s   
zSLSTM.__init__c                 C   s<   |  ddd¡}|  |¡\}}| jr|| }|  ddd¡}|S )Nr   r   é   )Úpermuter   r   )r   ÚxÚyÚ_r   r   r   Úforward   s   zSLSTM.forward)r   T)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚintÚboolr	   r   Ú__classcell__r   r   r   r   r      s    r   N)r   Útorchr   ÚModuler   r   r   r   r   Ú<module>   s   