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

Method Bak

tensorflow/contrib/recurrent/python/ops/recurrent.py:460–473  ·  view source on GitHub ↗

Backward step.

(*args)

Source from the content-addressed store, hash-verified

458
459 @function.Defun(*_Dtypes(bak_sig))
460 def Bak(*args):
461 """Backward step."""
462 (theta, state0, inputs, extras, d_state1) = _Pack(args, bak_sig)
463 (dtheta, dstate0, dinputs) = self._cell_grad(theta, state0, inputs,
464 extras, d_state1)
465 assert not function.get_extra_args(), (
466 'cell_grad is not pure with extra args: %s.' %
467 (function.get_extra_args()))
468 _AssertIsCompatible(dtheta, self._theta)
469 _AssertIsCompatible(dstate0, self._state)
470 _AssertIsCompatible(dinputs, self._inputs)
471 return _Flatten(
472 _ConvertNoneGradientToZeros([theta, state0, inputs],
473 [dtheta, dstate0, dinputs]))
474
475 # Define defuns used by a functional_ops.If in BackwardLoopBody.
476 state_if_sig = [self._state, self._state]

Callers

nothing calls this directly

Calls 4

_PackFunction · 0.85
_AssertIsCompatibleFunction · 0.85
_FlattenFunction · 0.70

Tested by

no test coverage detected