parameters: (op, grad)
docstring: Returns gradient of psi(n, x) with respect to n and x.
docstring_summary: Returns gradient of psi(n, x) with respect to n and x.
docstring_tokens: Returns gradient of psi ( n x ) with respect to n and x .
function: def _PolygammaGrad(op, grad):
    """Returns gradient of psi(n, x) with respect to n and x."""
    # TODO(tillahoffmann): Add derivative with respect to n
    n = op.inputs[0]
    x = op.inputs[1]
    # Broadcast gradients
    sn = array_ops.shape(n)
    sx = array_ops.shape(x)
    unused_rn, rx = gen_array_ops._broadcast_gradient_args(sn, sx)
    # Evaluate gradient
    with ops.control_dependencies([grad.op]):
      partial_x = math_ops.polygamma(n + 1, x)
      return (None,
              array_ops.reshape(math_ops.reduce_sum(partial_x * grad, rx), sx))
function_tokens: def _PolygammaGrad ( op , grad ) : # TODO(tillahoffmann): Add derivative with respect to n n = op . inputs [ 0 ] x = op . inputs [ 1 ] # Broadcast gradients sn = array_ops . shape ( n ) sx = array_ops . shape ( x ) unused_rn , rx = gen_array_ops . _broadcast_gradient_args ( sn , sx ) # Evaluate gradient with ops . control_dependencies ( [ grad . op ] ) : partial_x = math_ops . polygamma ( n + 1 , x ) return ( None , array_ops . reshape ( math_ops . reduce_sum ( partial_x * grad , rx ) , sx ) )