class_docstr: Function node of the computational graph.
  
  FunctionNode is a class representing a node in a computational graph. The
  node corresponds to an application of a differentiable function to input
  variables.
  
  When a differentiable function is applied to :class:`~chainer.Variable`
  objects,
  it creates an instance of FunctionNode implementation and calls its
  :meth:`apply` method. The :meth:`apply` method basically does the following
  three things.
  
  1. Adding an edge from the function node to the variable node corresponding
     to each input. The node of each input is extracted by
     :attr:`Variable.node <chainer.Variable.node>`.
  2. Computing the output arrays of the function.
  3. Creating a :class:`~chainer.Variable` object for each output array and
     adding an edge from the node of the variable to the function node.
  
  The output variables are then returned.
  
  .. admonition:: Example
  
     Let ``x`` be an instance of :class:`~chainer.Variable` and ``f`` be an
     instance of :class:`FunctionNode` taking only one argument.
     Then the following code
  
     >>> import numpy, chainer
     >>> x = chainer.Variable(numpy.zeros(10))
     >>> f = chainer.functions.math.identity.Identity()
     >>> y = f.apply((x,))[0]
  
     computes a new variable ``y`` and creates backward references. The
     backward references are actually set as per the following diagram::
  
         x.node <--- f <--- y.node
  
     If an application of another function ``g`` occurs as
  
     >>> g = chainer.functions.math.identity.Identity()
     >>> z = g.apply((x,))[0]
  
     then the graph grows with a branch::
  
                  |--- f <--- y.node
         x.node <-+
                  |--- g <--- z.node
  
     Note that the branching is correctly managed on backward computation,
     i.e. the gradients from ``f`` and ``g`` are accumulated to the gradient
     of ``x``.
  
  Every function-node implementation should provide :meth:`forward` and
  :meth:`backward`. Instead of overriding :meth:`forward`, one can also
  implement :meth:`forward_cpu` and :meth:`forward_gpu` when the
  implementations for CPU and GPU arrays are totally different.
  
  Note that the input and output variables are inaccessible from
  :meth:`backward` by default. If it needs accesses to these variables, the
  :meth:`forward` method (or its CPU/GPU variants) has to call
  :meth:`retain_inputs` and :meth:`retain_outputs` appropriately. The
  retained input/output variables can be accessed from :meth:`backward` by
  calling :meth:`get_retained_inputs` and :meth:`get_retained_outputs`.
  
  .. note::
  
     There are two types of differentiable functions in Chainer (since v3).
     The first type is of a function using a subclass of
     :class:`~chainer.Function`,
     which is called *old-style differentiable function*. The second type is
     of a function using a subclass of :class:`FunctionNode`, which is called
     **new-style differentiable function**. There are several advantages on
     using the new-style differentiable function.
  
     - The new-style differentiable function supports *differentiable
       backpropagation*. The backpropagated gradients computed through the
       new-style differentiable functions themselves support further
       backpropagations so that the automatic higher-order differentiation is
       available.
     - The backpropagation of the new-style differentiable function can be
       more computationally efficient because the interface allows an
       implementation to omit the computation of unneeded input gradients.
  
     Note that the new-style differentiable function is the standard way of
     defining a function node of the computational graph in Chainer; old-
     style differentiable functions are implemented as wrappers of the new-
     style differentiable functions.
  
  Attributes:
      ~FunctionNode.inputs: A tuple of the input
          :class:`~chainer.variable.VariableNode` objects.
      ~FunctionNode.outputs: A tuple of weak references to the output
          :class:`~chainer.variable.VariableNode` objects.
      ~FunctionNode.rank (int): An ordinal following the topological order
          of the computational graph.
      ~FunctionNode.stack: Stack trace retrieved at the forward computation.
          The stack trace is available only in the debug mode.
  
  .. versionadded:: 3.0.0
class_docstr_tok: ["Function","node","of","the","computational","graph",".","FunctionNode","is","a","class","representing","a","node","in","a","computational","graph",".","The","node","corresponds","to","an","application","of","a","differentiable","function","to","input","variables",".","When","a","differentiable","function","is","applied","to",":","class",":","`","~chainer.Variable","`","objects",",","it","creates","an","instance","of","FunctionNode","implementation","and","calls","its",":","meth",":","`","apply","`","method",".","The",":","meth",":","`","apply","`","method","basically","does","the","following","three","things",".","1",".","Adding","an","edge","from","the","function","node","to","the","variable","node","corresponding","to","each","input",".","The","node","of","each","input","is","extracted","by",":","attr",":","`","Variable.node","<","chainer.Variable.node",">","`",".","2",".","Computing","the","output","arrays","of","the","function",".","3",".","Creating","a",":","class",":","`","~chainer.Variable","`","object","for","each","output","array","and","adding","an","edge","from","the","node","of","the","variable","to","the","function","node",".","The","output","variables","are","then","returned",".","..","admonition",":",":","Example","Let","``","x","``","be","an","instance","of",":","class",":","`","~chainer.Variable","`","and","``","f","``","be","an","instance","of",":","class",":","`","FunctionNode","`","taking","only","one","argument",".","Then","the","following","code",">",">",">","import","numpy",",","chainer",">",">",">","x","=","chainer.Variable","(","numpy.zeros","(","10",")",")",">",">",">","f","=","chainer.functions.math.identity.Identity","(",")",">",">",">","y","=","f.apply","(","(","x",",",")",")","[","0","]","computes","a","new","variable","``","y","``","and","creates","backward","references",".","The","backward","references","are","actually","set","as","per","the","following","diagram",":",":","x.node","<","--","-","f","<","--","-","y.node","If","an","application","of","another","function","``","g","``","occurs","as",">",">",">","g","=","chainer.functions.math.identity.Identity","(",")",">",">",">","z","=","g.apply","(","(","x",",",")",")","[","0","]","then","the","graph","grows","with","a","branch",":",":","|","--","-","f","<","--","-","y.node","x.node","<","-+","|","--","-","g","<","--","-","z.node","Note","that","the","branching","is","correctly","managed","on","backward","computation",",","i.e",".","the","gradients","from","``","f","``","and","``","g","``","are","accumulated","to","the","gradient","of","``","x","``",".","Every","function-node","implementation","should","provide",":","meth",":","`","forward","`","and",":","meth",":","`","backward","`",".","Instead","of","overriding",":","meth",":","`","forward","`",",","one","can","also","implement",":","meth",":","`","forward_cpu","`","and",":","meth",":","`","forward_gpu","`","when","the","implementations","for","CPU","and","GPU","arrays","are","totally","different",".","Note","that","the","input","and","output","variables","are","inaccessible","from",":","meth",":","`","backward","`","by","default",".","If","it","needs","accesses","to","these","variables",",","the",":","meth",":","`","forward","`","method","(","or","its","CPU\/GPU","variants",")","has","to","call",":","meth",":","`","retain_inputs","`","and",":","meth",":","`","retain_outputs","`","appropriately",".","The","retained","input\/output","variables","can","be","accessed","from",":","meth",":","`","backward","`","by","calling",":","meth",":","`","get_retained_inputs","`","and",":","meth",":","`","get_retained_outputs","`",".","..","note",":",":","There","are","two","types","of","differentiable","functions","in","Chainer","(","since","v3",")",".","The","first","type","is","of","a","function","using","a","subclass","of",":","class",":","`","~chainer.Function","`",",","which","is","called","*","old-style","differentiable","function","*",".","The","second","type","is","of","a","function","using","a","subclass","of",":","class",":","`","FunctionNode","`",",","which","is","called","*","*","new-style","differentiable","function","*","*",".","There","are","several","advantages","on","using","the","new-style","differentiable","function",".","-","The","new-style","differentiable","function","supports","*","differentiable","backpropagation","*",".","The","backpropagated","gradients","computed","through","the","new-style","differentiable","functions","themselves","support","further","backpropagations","so","that","the","automatic","higher-order","differentiation","is","available",".","-","The","backpropagation","of","the","new-style","differentiable","function","can","be","more","computationally","efficient","because","the","interface","allows","an","implementation","to","omit","the","computation","of","unneeded","input","gradients",".","Note","that","the","new-style","differentiable","function","is","the","standard","way","of","defining","a","function","node","of","the","computational","graph","in","Chainer",";","old-","style","differentiable","functions","are","implemented","as","wrappers","of","the","new-","style","differentiable","functions",".","Attributes",":","~FunctionNode.inputs",":","A","tuple","of","the","input",":","class",":","`","~chainer.variable.VariableNode","`","objects",".","~FunctionNode.outputs",":","A","tuple","of","weak","references","to","the","output",":","class",":","`","~chainer.variable.VariableNode","`","objects",".","~FunctionNode.rank","(","int",")",":","An","ordinal","following","the","topological","order","of","the","computational","graph",".","~FunctionNode.stack",":","Stack","trace","retrieved","at","the","forward","computation",".","The","stack","trace","is","available","only","in","the","debug","mode",".","..","versionadded",":",":","3.0.0"]
docstr: Short text that represents the function.
  
  The default implementation returns its type name.
  Each function should override it to give more information.
docstr_tok: ["Short","text","that","represents","the","function",".","The","default","implementation","returns","its","type","name",".","Each","function","should","override","it","to","give","more","information","."]
code: def label(self):
      """Short text that represents the function.
  
      The default implementation returns its type name.
      Each function should override it to give more information.
  
      """
      return self.__class__.__name__
  
imports: import collections
  import contextlib
  import heapq
  import inspect
  import traceback
  import weakref
  import six
  import chainer
  from chainer import _backprop_utils
  from chainer import backend
  from chainer.backends import cuda
  from chainer import configuration
  from chainer import function_hook
  from chainer.graph_optimizations.static_graph_utilities import static_forward_optimizations
  from chainer import utils
  from chainer.utils import type_check
  from chainer import variable
  import chainerx
label_desc: Use image node_id 3 for calling the FunctionNode obj's underlying member method code with example usage: obj.label() and returns: self