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.
docstr: Converts graph in dot format.
  
  `label` property of is used as short description of each node.
  Returns:
      str: The graph in dot format.
docstr_tok: ["Converts","graph","in","dot","format",".","`","label","`","property","of","is","used","as","short","description","of","each","node",".","Returns",":","str",":","The","graph","in","dot","format","."]
code: def _to_dot(self):
      """Converts graph in dot format.
  
      `label` property of is used as short description of each node.
      Returns:
          str: The graph in dot format.
  
      """
      ret = "digraph graphname{rankdir=%s;" % self.rankdir
  
      if self.remove_variable:
          self.nodes, self.edges = _skip_variable(
              self.nodes, self.edges
          )
  
      for node in self.nodes:
          assert isinstance(
              node, (variable.VariableNode, function_node.FunctionNode)
          )
          if isinstance(node, variable.VariableNode):
              if not self.remove_variable:
                  ret += DotNode(
                      node, self.variable_style, self.show_name
                  ).label
          else:
              ret += DotNode(
                  node, self.function_style, self.show_name
              ).label
  
      drawn_edges = []
      for edge in self.edges:
          head, tail = edge
          if isinstance(head, variable.VariableNode) and isinstance(
              tail, function_node.FunctionNode
          ):
              head_attr = self.variable_style
              tail_attr = self.function_style
          elif isinstance(
              head, function_node.FunctionNode
          ) and isinstance(tail, variable.VariableNode):
              head_attr = self.function_style
              tail_attr = self.variable_style
          else:
              if not self.remove_variable:
                  raise TypeError(
                      "head and tail should be the set of "
                      "VariableNode and Function"
                  )
              else:
                  head_attr = self.function_style
                  tail_attr = self.function_style
          head_node = DotNode(head, head_attr, self.show_name)
          tail_node = DotNode(tail, tail_attr, self.show_name)
          edge = (head_node.id_, tail_node.id_)
          if edge in drawn_edges:
              continue
          ret += "%s -> %s;" % edge
          drawn_edges.append(edge)
      ret += "}"
      return ret
  
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 2 for calling the ComputationalGraph obj's underlying member method code with example usage: obj._to_dot() and returns: ret