parameters: (op)
return_statement: return gradient_registry.lookup(op_type)
docstring: Returns the function that computes gradients for "op".
docstring_summary: Returns the function that computes gradients for "op".
docstring_tokens: Returns the function that computes gradients for op .
function: def get_gradient_function(op):
    """Returns the function that computes gradients for "op"."""
    if not op.inputs:
      return None
  
    gradient_function = op._gradient_function  # pylint: disable=protected-access
    if gradient_function:
      return gradient_function
  
    try:
      op_type = op.get_attr("_gradient_op_type")
    except ValueError:
      op_type = op.type
    return gradient_registry.lookup(op_type)
function_tokens: def get_gradient_function ( op ) : if not op . inputs : return None gradient_function = op . _gradient_function # pylint: disable=protected-access if gradient_function : return gradient_function try : op_type = op . get_attr ( "_gradient_op_type" ) except ValueError : op_type = op . type return gradient_registry . lookup ( op_type )