o
    ®Ÿ?eÀ  ã                   @   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_gradZuse_peepholeN© )ZinputsZoutputsr   Zblock_lstm_gradZget_attr)ÚopZgradsr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú_r   r   Zx_gradZcs_prev_gradZh_prev_gradZw_gradZwci_gradZwcf_gradZwco_gradZb_gradr   r   ú_/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/ops/rnn_grad.pyÚ_block_lstm_grad   s^   
ÿþýüûúùø	÷
öõôóòñðïî
íÿÿr   Z	BlockLSTMZBlockLSTMV2N)Ú__doc__Ztensorflow.python.frameworkr   Ztensorflow.python.opsr   r   ZRegisterGradientr   r   r   r   Ú<module>   s   