@ops.RegisterGradient('Batch')
def _BatchGrad(op, *out_grads):
    'Gradient for batch op.'
    gradients = []
    for i in range(len(op.inputs)):
        gradients.append(gen_batch_ops.unbatch(out_grads[i], op.outputs[(- 2)], op.outputs[(- 1)], timeout_micros=op.get_attr('grad_timeout_micros'), shared_name='batch_gradient_{}_{}'.format(op.name, i)))
    return gradients
Gradient for batch op.
@ops.RegisterGradient('Batch')
def _BatchGrad(op, *out_grads):
    
    gradients = []
    for i in range(len(op.inputs)):
        gradients.append(gen_batch_ops.unbatch(out_grads[i], op.outputs[(- 2)], op.outputs[(- 1)], timeout_micros=op.get_attr('grad_timeout_micros'), shared_name='batch_gradient_{}_{}'.format(op.name, i)))
    return gradients