@tf.RegisterGradient('VariableLSTM')
def _variable_lstm_grad(op, act_grad, gate_grad, mem_grad):
 initial_state = op.inputs[1]
 initial_memory = op.inputs[2]
 w_m_m = op.inputs[3]
 act = op.outputs[0]
 gate_raw_act = op.outputs[1]
 memory = op.outputs[2]
 return rnn.variable_lstm_grad(initial_state, initial_memory, w_m_m, act, gate_raw_act, memory, act_grad, gate_grad, mem_grad)

@ tf . RegisterGradient ( 'VariableLSTM' ) def _variable_lstm_grad ( op , act_grad , gate_grad , mem_grad ) : initial_state = op . inputs [ 1 ] initial_memory = op . inputs [ 2 ] w_m_m = op . inputs [ 3 ] act = op . outputs [ 0 ] gate_raw_act = op . outputs [ 1 ] memory = op . outputs [ 2 ] return rnn . variable_lstm_grad ( initial_state , initial_memory , w_m_m , act , gate_raw_act , memory , act_grad , gate_grad , mem_grad )
gradient function for the variablelstm op .