code: def forget(func, *xs):
      """Calls a function without storing intermediate results.
  
      On a forward propagation, Chainer normally stores all intermediate results
      of :class:`~chainer.variable.VariableNode`\\ s on a computational graph as
      they are required on backward propagation.
      Sometimes these results consume too much memory.
      ``F.forget`` *forgets* such intermediate results on forward propagation,
      and still supports backpropagation with recalculation.
  
      On a forward propagation, ``F.forget`` calls a given function with given
      variables without creating a computational graph. That means, no
      intermediate results are stored.
      On a backward propagation, ``F.forget`` calls the given function again to
      create a computational graph for backpropagation.
  
      ``F.forget`` reduces internal memory usage, whereas it requires more
      calculation time as it calls the function twice.
  
      .. admonition:: Example
  
         Let ``f`` be a function defined as:
  
         >>> def f(a, b):
         ...   return (a + b) * a
  
         and, ``x`` and ``y`` be :class:`~chainer.Variable`\\ s:
  
         >>> x = chainer.Variable(np.random.uniform(-1, 1, 5).astype(np.float32))
         >>> y = chainer.Variable(np.random.uniform(-1, 1, 5).astype(np.float32))
  
         When ``z`` is calculated as ``z = f(x, y)``, its intermediate result
         ``x + y`` is stored in memory. Instead, if you call ``f`` with
         ``F.forget``:
  
         >>> z = F.forget(f, x, y)
  
         intermediate ``x + y`` is forgotten.
  
      .. note::
  
          ``F.forget`` does not support functions which behave differently in
          multiple calls with the same inputs, such as
          :meth:`F.dropout() <chainer.functions.dropout>` and
          :meth:`F.negative_sampling() <chainer.functions.negative_sampling>`.
  
      .. note::
  
          In case input argument variables are of :ref:`ndarray` objects,
          arguments will automatically be
          converted to :class:`~chainer.Variable`\\ s.
          This conversion takes place to ensure that this function is included
          in the computational graph to enable backward computations.
  
      .. note::
  
          ``F.forget`` does not support double backpropagation.
  
      .. note::
  
          If you want to use ``F.forget`` to a link which updates the link's
          internal information every time the forward computation is called,
          please ensure that the information is updated just once in a single
          iteration. You may use the ``chainer.config.in_recomputing`` flag to
          check if the forward computation is the first call in an iteration.
          Please see the implementation of
          :class:`~chainer.links.BatchNormalization` for detail.
  
      Args:
          func (callable): A function to call. It needs to be called with
              :class:`~chainer.Variable` object(s) and to return a
              :class:`~chainer.Variable` object or a tuple of
              :class:`~chainer.Variable` objects.
          xs (:class:`tuple` of :class:`~chainer.Variable` or :ref:`ndarray`):
              Argument variables of the function.
  
      Returns:
          ~chainer.Variable: A variable ``func`` returns. If it returns a tuple,
          the method returns a tuple too.
  
      """
      xs = tuple(
          x
          if isinstance(x, variable.Variable)
          else variable.Variable(x, requires_grad=True)
          for x in xs
      )
      y = Forget(func).apply(xs)
      if len(y) == 1:
          (y,) = y
      return y
  
file_path: chainer/chainer/functions/util/forget.py
imports: import chainer
  from chainer import function
  from chainer import function_node
  from chainer import variable
label_desc: Use image node_id 2 for calling a global function with example usage: forget(func) and returns: y