o
    Ô2úhÀ  ã                   @   sD   d Z ddlmZ ddlmZ dd„ Ze d¡eƒ e d¡eƒ dS )	z)Gradients for (block) GRU/LSTM operators.é    )Úops)Úgen_rnn_opsc              	   G   sè   | j \	}}}}}}}}	}
| j\}}}}}}}|\}}}}}}}tjdi d|“d|“d|“d|“d|“d|“d|“d|	“d	|
“d
|“d|“d|“d|“d|“d|“d|“d|“d|“d|  d¡“Ž\}}}}}}}}d||||||||f	S )zGradient for the BlockLSTM op.Úseq_len_maxÚxÚcs_prevÚh_prevÚwÚwciÚwcfÚwcoÚbÚiÚcsÚfÚoÚciÚcoÚhÚcs_gradÚh_gradÚuse_peepholeN© )ÚinputsÚoutputsr   Úblock_lstm_gradÚget_attr)ÚopÚgradsr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú_r   r   Úx_gradÚcs_prev_gradÚh_prev_gradÚw_gradÚwci_gradÚwcf_gradÚwco_gradÚb_gradr   r   úY/var/www/html/chatgem/venv/lib/python3.10/site-packages/tensorflow/python/ops/rnn_grad.pyÚ_block_lstm_grad   s^   
ÿþýüûúùø	÷
öõôóòñðïî
íÿÿr(   Ú	BlockLSTMÚBlockLSTMV2N)Ú__doc__Útensorflow.python.frameworkr   Útensorflow.python.opsr   r(   ÚRegisterGradientr   r   r   r'   Ú<module>   s   