class_docstr: Simple Graph with GraphViz.
  
  Example: 
  
  .. code-block:: python
  
    import nnabla as nn
    import nnabla.functions as F
    import nnabla.parametric_functions as PF
  
    import nnabla.experimental.viewers as V
  
    # Model definition
    def network(image, test=False):
        h = image
        h /= 255.0
        h = PF.convolution(h, 16, kernel=(3, 3), pad=(1, 1), name="conv")
        h = PF.batch_normalization(h, name="bn", batch_stat=not test)
        h = F.relu(h)
        pred = PF.affine(h, 10, name='fc')
        return pred
  
    # Model
    image = nn.Variable([4, 3, 32, 32])
    pred = network(image, test=False)
  
    # Graph Viewer
    graph = V.SimpleGraph(verbose=False)
    graph.view(pred)
    graph.save(pred, "sample_grpah")
  
  
  If the parameters are module-scoped, for example, the ``pred`` comes from a
  module output, parameters should be obtained beforehand then passed to view():
  
  Example:
  
  .. code-block:: python
  
    import nnabla as nn
    import nnabla.functions as F
    from nnabla.core.modules import ConvBn
  
    import nnabla.experimental.viewers as V
  
    class TSTNetNormal(nn.Module):
        def __init__(self):
            self.conv_bn_1 = ConvBn(1)
            self.conv_bn_2 = ConvBn(1)
  
        def call(self, x1, x2):
            y1 = self.conv_bn_1(x1)
            y2 = self.conv_bn_2(x2)
            y = F.concatenate(y1, y2, axis=1)
            return y
  
    tnd = TSTNetNormal()
  
    v1 = nn.Variable((4, 3, 32, 32))
    v2 = nn.Variable((4, 3, 32, 32))
  
    ya = tnd(v1, v2)
  
    graph = V.SimpleGraph(verbose=False)
    graph.view(ya, params=tnd.get_parameters(grad_only=False))
docstr: Create a :obj:`graphviz.Digraph` object given the leaf variable of a
  computation graph.
  
  One of nice things of getting ``Digraph`` directly is that the drawn
  graph can be displayed inline in a Jupyter notebook as described in
  `Graphviz documentation <https://graphviz.readthedocs.io/en/stable/manual.html#jupyter-notebooks>`_.
  
  Args:
      vleaf (`nnabla.Variable`):
          End variable. All variables and functions which can be
          traversed from this variable are shown in the reuslt.
      params (dict):
          The parameters dictionary, it can be obtained by nn.get_parameters().
      format (str):
          Force overwrite ``format`` (``'pdf', 'png', ...)``) configuration.
  
  Returns: graphviz.Digraph
docstr_tok: ["Create","a",":","obj",":","`","graphviz.Digraph","`","object","given","the","leaf","variable","of","a","computation","graph",".","One","of","nice","things","of","getting","``","Digraph","``","directly","is","that","the","drawn","graph","can","be","displayed","inline","in","a","Jupyter","notebook","as","described","in","`","Graphviz","documentation","<","https",":","\/\/graphviz.readthedocs.io\/en\/stable\/manual.html","#","jupyter-notebooks",">","`","_",".","Args",":","vleaf","(","`","nnabla.Variable","`",")",":","End","variable",".","All","variables","and","functions","which","can","be","traversed","from","this","variable","are","shown","in","the","reuslt",".","params","(","dict",")",":","The","parameters","dictionary",",","it","can","be","obtained","by","nn.get_parameters","(",")",".","format","(","str",")",":","Force","overwrite","``","format","``","(","``","'pdf","'",",","'png","'",",","...",")","``",")","configuration",".","Returns",":","graphviz.Digraph"]
code: def create_graphviz_digraph(self, vleaf, params=None, format=None):
      """
      Create a :obj:`graphviz.Digraph` object given the leaf variable of a
      computation graph.
  
      One of nice things of getting ``Digraph`` directly is that the drawn
      graph can be displayed inline in a Jupyter notebook as described in
      `Graphviz documentation <https://graphviz.readthedocs.io/en/stable/manual.html#jupyter-notebooks>`_.
  
      Args:
          vleaf (`nnabla.Variable`):
              End variable. All variables and functions which can be
              traversed from this variable are shown in the reuslt.
          params (dict):
              The parameters dictionary, it can be obtained by nn.get_parameters().
          format (str):
              Force overwrite ``format`` (``'pdf', 'png', ...)``) configuration.
  
      Returns: graphviz.Digraph
  
      """
      from nnabla import get_parameters
      import copy
  
      try:
          from graphviz import Digraph
      except:
          raise ImportError("Install graphviz. `pip install graphviz.`")
      if format is None:
          format = self._format
      graph = Digraph(format=format)
      graph.attr("node", style="filled")
  
      if params is None:
          params = get_parameters(grad_only=False)
      var2name = {v.data: k for k, v in params.items()}
      fun2scope = {}
      var2postname = copy.copy(var2name)
  
      def fscope(f):
          names = [
              var2name[v.data] for v in f.inputs if v.data in var2name
          ]
          if names:
              f_names = [os.path.dirname(names[0]), *names[1:]]
              c = os.path.commonprefix(f_names)
              fun2scope[f] = c
              for n in names:
                  var2postname[params[n].data] = n[len(c) + 1 :]
  
      vleaf.visit(fscope)
      func = self.functor(
          graph,
          self._verbose,
          fun2scope=fun2scope,
          var2name=var2postname,
      )
      vleaf.visit(func)
      return graph
  
file_path: nnabla/python/src/nnabla/experimental/viewers.py
imports: import json
  import os
  from collections import defaultdict
  import numpy
label_desc: Use image node_id 4 for calling the SimpleGraph obj's underlying member method code with example usage: obj.create_graphviz_digraph(vleaf, params, format) and returns: graph