parameters: (op, grad)
docstring: Returns gradient of xdivy(x, y) with respect to x and y.
docstring_summary: Returns gradient of xdivy(x, y) with respect to x and y.
docstring_tokens: Returns gradient of xdivy ( x y ) with respect to x and y .
function: def _XDivyGrad(op, grad):
    """Returns gradient of xdivy(x, y) with respect to x and y."""
    x = op.inputs[0]
    y = op.inputs[1]
    sx = array_ops.shape(x)
    sy = array_ops.shape(y)
    rx, ry = gen_array_ops.broadcast_gradient_args(sx, sy)
    with ops.control_dependencies([grad]):
      not_zero_x = math_ops.cast(
          math_ops.not_equal(x, math_ops.cast(0., dtype=x.dtype)), dtype=x.dtype)
      partial_x = gen_math_ops.xdivy(not_zero_x, y)
      partial_y = gen_math_ops.xdivy(math_ops.negative(x), y**2)
      return (array_ops.reshape(math_ops.reduce_sum(partial_x * grad, rx), sx),
              array_ops.reshape(math_ops.reduce_sum(partial_y * grad, ry), sy))
function_tokens: def _XDivyGrad ( op , grad ) : x = op . inputs [ 0 ] y = op . inputs [ 1 ] sx = array_ops . shape ( x ) sy = array_ops . shape ( y ) rx , ry = gen_array_ops . broadcast_gradient_args ( sx , sy ) with ops . control_dependencies ( [ grad ] ) : not_zero_x = math_ops . cast ( math_ops . not_equal ( x , math_ops . cast ( 0. , dtype = x . dtype ) ) , dtype = x . dtype ) partial_x = gen_math_ops . xdivy ( not_zero_x , y ) partial_y = gen_math_ops . xdivy ( math_ops . negative ( x ) , y ** 2 ) return ( array_ops . reshape ( math_ops . reduce_sum ( partial_x * grad , rx ) , sx ) , array_ops . reshape ( math_ops . reduce_sum ( partial_y * grad , ry ) , sy ) )