class_docstr: __init__(root_name, filename='cg.dot', variable_style=None, function_style=None)
  
  Trainer extension to dump a computational graph.
  
  This extension dumps a computational graph. The graph is output in DOT
  language. If graphviz is available, this also renders and saves the image
  of the computational graph.
  
  It only dumps a graph at the first invocation.
  
  .. note::
     The computational graph is not kept by default. This
     extension changes this behavior until the first invocation. **It is
     strongly recommended that you use it with the default trigger setting.**
  
     The detailed behavior of this extension is as follows.
  
     1. In its initializer, it turns on the
        ``chainer.config.keep_graph_on_report`` flag.
     2. At the first iteration, it dumps the graph using the graph held by
        the reported variable.
     3. After dumping the graph, it turns off the flag (if it was originally
        turned off) so that any variable reported afterward does not hold
        a computational graph.
  
     When the ``keep_graph_on_report`` flag is turned on, the computational
     graph created by the updater is kept during the invocation of
     extensions. It will cause an unnecessarily large memory consumption
     when an extension also uses a large amount of memory, e.g.
     :class:`~chainer.training.extensions.Evaluator`.
  
     With the default setting, the ``DumpGraph`` extension is called at the
     first iteration. Since :class:`~chainer.training.extensions.Evaluator`
     is not called at the first iteration in most cases, it does not cause
     any memory problem.
  
  Args:
      root_name (str): Name of the root of the computational graph. The
          root variable is retrieved by this name from the observation
          dictionary of the trainer.
      filename (str): Output file name.
          For historical reasons ``out_name`` is also accepted as an alias
          of this argument.
      variable_style (dict): Dot node style for variables. Each variable is
          rendered by an octagon by default.
      function_style (dict): Dot node style for functions. Each function is
          rendered by a rectangular by default.
  
  .. seealso::
     See :func:`~chainer.computational_graph.build_computational_graph`
     for the ``variable_style`` and ``function_style`` arguments.
code: def serialize(self, serializer):
      self._original_flag = serializer(
          "_original_flag", self._original_flag
      )
      self._flag_called = serializer("_flag_called", self._flag_called)
  
file_path: chainer/chainer/training/extensions/computational_graph.py
imports: import os
  import subprocess
  from chainer import computational_graph
  from chainer import configuration
  from chainer.training import extension
  from chainer.utils import argument
  from chainer import variable
label_desc: Use image node_id 5 for calling the DumpGraph obj's underlying member method code with example usage: obj.serialize(serializer) without return types