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.
            format (str):
                Force overwrite ``format`` (``'pdf', 'png', ...)``) configuration.

        Returns: graphviz.Digraph

def create_graphviz_digraph(self, vleaf, 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.
            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")

        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:
                c = os.path.commonprefix(names)
                fun2scope[f] = c
                for n in names:
                    var2postname[params[n].data] = n[len(c):]
        vleaf.visit(fscope)
        func = self.functor(graph, self._verbose,
                            fun2scope=fun2scope, var2name=var2postname)
        vleaf.visit(func)
        return graph