MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _block_lstm_grad

Function _block_lstm_grad

tensorflow/python/ops/rnn_grad.py:24–51  ·  view source on GitHub ↗

Gradient for the BlockLSTM op.

(op, *grads)

Source from the content-addressed store, hash-verified

22
23
24def _block_lstm_grad(op, *grads):
25 """Gradient for the BlockLSTM op."""
26 seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b = op.inputs
27 i, cs, f, o, ci, co, h = op.outputs
28 _, cs_grad, _, _, _, _, h_grad = grads
29 (x_grad, cs_prev_grad, h_prev_grad, w_grad, wci_grad, wcf_grad, wco_grad,
30 b_grad) = gen_rnn_ops.block_lstm_grad(
31 seq_len_max=seq_len_max,
32 x=x,
33 cs_prev=cs_prev,
34 h_prev=h_prev,
35 w=w,
36 wci=wci,
37 wcf=wcf,
38 wco=wco,
39 b=b,
40 i=i,
41 cs=cs,
42 f=f,
43 o=o,
44 ci=ci,
45 co=co,
46 h=h,
47 cs_grad=cs_grad,
48 h_grad=h_grad,
49 use_peephole=op.get_attr("use_peephole"))
50 return (None, x_grad, cs_prev_grad, h_prev_grad, w_grad, wci_grad, wcf_grad,
51 wco_grad, b_grad)
52
53
54ops.RegisterGradient("BlockLSTM")(_block_lstm_grad)

Callers

nothing calls this directly

Calls 1

get_attrMethod · 0.45

Tested by

no test coverage detected