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

Function _BatchGrad

tensorflow/contrib/batching/python/ops/batch_ops.py:31–42  ·  view source on GitHub ↗

Gradient for batch op.

(op, *out_grads)

Source from the content-addressed store, hash-verified

29
30@ops.RegisterGradient("Batch")
31def _BatchGrad(op, *out_grads): # pylint: disable=invalid-name
32 """Gradient for batch op."""
33 gradients = []
34 for i in range(len(op.inputs)):
35 gradients.append(
36 gen_batch_ops.unbatch(
37 out_grads[i],
38 op.outputs[-2],
39 op.outputs[-1],
40 timeout_micros=op.get_attr("grad_timeout_micros"),
41 shared_name="batch_gradient_{}_{}".format(op.name, i)))
42 return gradients
43
44
45@ops.RegisterGradient("Unbatch")

Callers

nothing calls this directly

Calls 5

unbatchMethod · 0.80
rangeFunction · 0.50
appendMethod · 0.45
get_attrMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected