original_docstring: r"""Computes the gradient function for function f via backpropagation.
  
    Args:
      input: A list of `Tensor` objects. a list of input tensors of size N + M;
      Tout: A list of `tf.DTypes` that has length `>= 1`.
        the type list for the input list.
      f: A function decorated with @Defun.
        The function we want to compute the gradient for.
  
        The function 'f' must be a numerical function which takes N inputs and
        produces M outputs. Its gradient function 'g', which is computed by
        this SymbolicGradient op is a function taking N + M inputs and
        produces N outputs.
  
        I.e. if we have
           (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
        then, g is
           (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
                                             dL/dy1, dL/dy2, ..., dL/dy_M),
  
        where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
        loss function). dL/dx_i is the partial derivative of L with respect
        to x_i.
  
        (Needs some math expert to say the comment above better.)
      name: A name for the operation (optional).
  
    Returns:
      A list of `Tensor` objects of type `Tout`.
    
docstring: r"""Computes the gradient function for function f via backpropagation.
docstring_tokens: r " " " Computes the gradient function for function f via backpropagation .
code: def symbolic_gradient(input, Tout, f, name=None):
    r"""Computes the gradient function for function f via backpropagation.
  
    Args:
      input: A list of `Tensor` objects. a list of input tensors of size N + M;
      Tout: A list of `tf.DTypes` that has length `>= 1`.
        the type list for the input list.
      f: A function decorated with @Defun.
        The function we want to compute the gradient for.
  
        The function 'f' must be a numerical function which takes N inputs and
        produces M outputs. Its gradient function 'g', which is computed by
        this SymbolicGradient op is a function taking N + M inputs and
        produces N outputs.
  
        I.e. if we have
           (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
        then, g is
           (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
                                             dL/dy1, dL/dy2, ..., dL/dy_M),
  
        where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
        loss function). dL/dx_i is the partial derivative of L with respect
        to x_i.
  
        (Needs some math expert to say the comment above better.)
      name: A name for the operation (optional).
  
    Returns:
      A list of `Tensor` objects of type `Tout`.
    """
    _ctx = _context._context or _context.context()
    if _ctx is not None and _ctx._thread_local_data.is_eager:
      try:
        _result = _pywrap_tensorflow.TFE_Py_FastPathExecute(
          _ctx._context_handle, _ctx._thread_local_data.device_name,
          "SymbolicGradient", name, _ctx._post_execution_callbacks, input,
          "Tout", Tout, "f", f)
        return _result
      except _core._FallbackException:
        try:
          return symbolic_gradient_eager_fallback(
              input, Tout=Tout, f=f, name=name, ctx=_ctx)
        except _core._SymbolicException:
          pass  # Add nodes to the TensorFlow graph.
      except _core._NotOkStatusException as e:
        if name is not None:
          message = e.message + " name: " + name
        else:
          message = e.message
        _six.raise_from(_core._status_to_exception(e.code, message), None)
    # Add nodes to the TensorFlow graph.
    if not isinstance(Tout, (list, tuple)):
      raise TypeError(
          "Expected list for 'Tout' argument to "
          "'symbolic_gradient' Op, not %r." % Tout)
    Tout = [_execute.make_type(_t, "Tout") for _t in Tout]
    _, _, _op = _op_def_lib._apply_op_helper(
          "SymbolicGradient", input=input, Tout=Tout, f=f, name=name)
    _result = _op.outputs[:]
    _inputs_flat = _op.inputs
    _attrs = ("Tin", _op.get_attr("Tin"), "Tout", _op.get_attr("Tout"), "f",
              _op.get_attr("f"))
    _execute.record_gradient(
        "SymbolicGradient", _inputs_flat, _attrs, _result, name)
    return _result
code_tokens: def symbolic_gradient ( input , Tout , f , name = None ) : _ctx = _context . _context or _context . context ( ) if _ctx is not None and _ctx . _thread_local_data . is_eager : try : _result = _pywrap_tensorflow . TFE_Py_FastPathExecute ( _ctx . _context_handle , _ctx . _thread_local_data . device_name , "SymbolicGradient" , name , _ctx . _post_execution_callbacks , input , "Tout" , Tout , "f" , f ) return _result except _core . _FallbackException : try : return symbolic_gradient_eager_fallback ( input , Tout = Tout , f = f , name = name , ctx = _ctx ) except _core . _SymbolicException : pass except _core . _NotOkStatusException as e : if name is not None : message = e . message + " name: " + name else : message = e . message _six . raise_from ( _core . _status_to_exception ( e . code , message ) , None ) if not isinstance ( Tout , ( list , tuple ) ) : raise TypeError ( "Expected list for 'Tout' argument to " "'symbolic_gradient' Op, not %r." % Tout ) Tout = [ _execute . make_type ( _t , "Tout" ) for _t in Tout ] _ , _ , _op = _op_def_lib . _apply_op_helper ( "SymbolicGradient" , input = input , Tout = Tout , f = f , name = name ) _result = _op . outputs [ : ] _inputs_flat = _op . inputs _attrs = ( "Tin" , _op . get_attr ( "Tin" ) , "Tout" , _op . get_attr ( "Tout" ) , "f" , _op . get_attr ( "f" ) ) _execute . record_gradient ( "SymbolicGradient" , _inputs_flat , _attrs , _result , name ) return _result
short_docstring: r"""Computes the gradient function for function f via backpropagation.
short_docstring_tokens: r " " " Computes the gradient function for function f via backpropagation .
comment: r"""Computes the gradient function for function f via backpropagation.
  
    Args:
      input: A list of `Tensor` objects. a list of input tensors of size N + M;
      Tout: A list of `tf.DTypes` that has length `>= 1`.
        the type list for the input list.
      f: A function decorated with @Defun.
        The function we want to compute the gradient for.
  
        The function 'f' must be a numerical function which takes N inputs and
        produces M outputs. Its gradient function 'g', which is computed by
        this SymbolicGradient op is a function taking N + M inputs and
        produces N outputs.
  
        I.e. if we have
           (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
        then, g is
           (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
                                             dL/dy1, dL/dy2, ..., dL/dy_M),
  
        where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
        loss function). dL/dx_i is the partial derivative of L with respect
        to x_i.
  
        (Needs some math expert to say the comment above better.)
      name: A name for the operation (optional).
  
    Returns:
      A list of `Tensor` objects of type `Tout`.
    """$SEP$# Add nodes to the TensorFlow graph.$SEP$# Add nodes to the TensorFlow graph.