parameters: (op, grad)
return_statement: return (array_ops.reshape(math_ops.reduce_sum(x_grad, rx), sx),
            -array_ops.reshape(math_ops.reduce_sum(x_grad, ry), sy))
docstring: Returns the gradient for (x-y)^2.
docstring_summary: Returns the gradient for (x-y)^2.
docstring_tokens: Returns the gradient for ( x - y ) ^2 .
function: def _SquaredDifferenceGrad(op, grad):
    """Returns the gradient for (x-y)^2."""
    x = op.inputs[0]
    y = op.inputs[1]
    sx = array_ops.shape(x)
    sy = array_ops.shape(y)
    # pylint: disable=protected-access
    rx, ry = gen_array_ops._broadcast_gradient_args(sx, sy)
    # pylint: enable=protected-access
    # .op works with Tensors or IndexedSlices
    with ops.control_dependencies([grad.op]):
      # The parens ensure that if grad is IndexedSlices, it'll get multiplied by
      # Tensor (not a number like 2.0) which causes it to convert to Tensor.
      x_grad = math_ops.scalar_mul(2.0, grad) * (x - y)
    return (array_ops.reshape(math_ops.reduce_sum(x_grad, rx), sx),
            -array_ops.reshape(math_ops.reduce_sum(x_grad, ry), sy))
function_tokens: def _SquaredDifferenceGrad ( op , grad ) : x = op . inputs [ 0 ] y = op . inputs [ 1 ] sx = array_ops . shape ( x ) sy = array_ops . shape ( y ) # pylint: disable=protected-access rx , ry = gen_array_ops . _broadcast_gradient_args ( sx , sy ) # pylint: enable=protected-access # .op works with Tensors or IndexedSlices with ops . control_dependencies ( [ grad . op ] ) : # The parens ensure that if grad is IndexedSlices, it'll get multiplied by # Tensor (not a number like 2.0) which causes it to convert to Tensor. x_grad = math_ops . scalar_mul ( 2.0 , grad ) * ( x - y ) return ( array_ops . reshape ( math_ops . reduce_sum ( x_grad , rx ) , sx ) , - array_ops . reshape ( math_ops . reduce_sum ( x_grad , ry ) , sy ) )