class_docstr: Class that represents computational graph.
  
  .. note::
  
      We assume that the computational graph is directed and acyclic.
  
  Args:
      nodes (list): List of nodes. Each node is either
           :class:`VariableNode` object or :class:`FunctionNode` object.
      edges (list): List of edges. Each edge consists of pair of nodes.
      variable_style (dict or `'default'`): Dot node style for variable.
          If the special value ``'default'`` is specified, the default
          configuration will be used.
      function_style (dict or `default`): Dot node style for function.
          If the special value ``'default'`` is specified, the default
          configuration will be used.
      rankdir (str): Direction of the graph that must be
          TB (top to bottom), BT (bottom to top), LR (left to right)
          or RL (right to left).
      remove_variable (bool): If ``True``, :class:`VariableNode`\ s are
          removed from the resulting computational graph. Only
          :class:`FunctionNode`\ s are shown in the output.
      show_name (bool): If ``True``, the ``name`` attribute of each node is
          added to the label of the node. Default is ``True``.
  
  .. note::
  
     The default configuration for ``variable_style`` is
     ``{'shape': 'octagon', 'fillcolor': '#E0E0E0', 'style': 'filled'}`` and
     the default configuration for ``function_style`` is
     ``{'shape': 'record', 'fillcolor': '#6495ED', 'style': 'filled'}``.
  
  .. note::
  
      The default behavior of :class:`~chainer.ComputationalGraph` has been
      changed from v1.23.0, so that it ouputs the richest representation of
      a graph as default, namely, styles are set and names of functions and
      variables are shown. To reproduce the same result as previous versions
      (<= v1.22.0), please specify `variable_style=None`,
      `function_style=None`, and `show_name=False` explicitly.
code: def __init__(
      self,
      nodes,
      edges,
      variable_style="default",
      function_style="default",
      rankdir="TB",
      remove_variable=False,
      show_name=True,
  ):
      # If `variable_style` and `function_style` is explicitly set to None,
      # use legacy (Chainer v1.22.0) style for backward compatibility.
      if variable_style is None:
          variable_style = {}
      elif variable_style == "default":
          variable_style = dict(_var_style)
  
      if function_style is None:
          function_style = {}
      elif function_style == "default":
          function_style = dict(_func_style)
  
      self.nodes = nodes
      self.edges = edges
      self.variable_style = variable_style
      self.function_style = function_style
      if rankdir not in ("TB", "BT", "LR", "RL"):
          raise ValueError("rankdir must be in TB, BT, LR or RL.")
      self.rankdir = rankdir
      self.remove_variable = remove_variable
      self.show_name = show_name
  
file_path: chainer/chainer/computational_graph.py
imports: import heapq
  from chainer import function_node
  from chainer import variable
label_desc: Use image node_id 1 to create a new ComputationalGraph object from inherited base classes: object with example: obj = ComputationalGraph(nodes, edges, variable_style, function_style, rankdir, remove_variable, show_name)