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

Function _CTCLossGradImpl

tensorflow/python/ops/ctc_ops.py:207–221  ·  view source on GitHub ↗
(op, grad_loss, _)

Source from the content-addressed store, hash-verified

205
206# pylint: disable=unused-argument
207def _CTCLossGradImpl(op, grad_loss, _):
208 # Outputs are: loss, grad
209 #
210 # Currently there is no way to take the second derivative of this op
211 # due to the fused implementation's interaction with tf.gradients(),
212 # so we make sure we prevent silently incorrect results by raising
213 # an error if the second derivative is requested via prevent_gradient.
214 grad_without_gradient = array_ops.prevent_gradient(
215 op.outputs[1],
216 message="Currently there is no way to take the second "
217 " derivative of ctc_loss due to the fused implementation's interaction "
218 " with tf.gradients()")
219 # Return gradient for inputs and None for
220 # labels_indices, labels_values and sequence_length
221 return [_BroadcastMul(grad_loss, grad_without_gradient), None, None, None]
222
223# pylint: disable=unused-argument
224@ops.RegisterGradient("CTCLoss")

Callers 2

_CTCLossGradFunction · 0.85
_CTCLossV2GradFunction · 0.85

Calls 1

_BroadcastMulFunction · 0.90

Tested by

no test coverage detected