o
    mi                     @   s&   d Z ddlmZ G dd dejZdS )zLSTM layers module.    )nnc                	       s<   e Zd ZdZdde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.
       TF	dimension
num_layersskipbidirectionalc                    s.   t    || _|| _tj||||d| _d S )N)r   )super__init__r   r   r   LSTMlstm)selfr   r   r   r   	__class__ </home/ubuntu/SpeechTokenizer/speechtokenizer/modules/lstm.pyr
      s   
zSLSTM.__init__c                 C   sP   | ddd}| |\}}| jr|ddd}| jr|| }| ddd}|S )Nr   r      )permuter   r   repeatr   )r   xy_r   r   r   forward   s   zSLSTM.forward)r   TF)	__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   