docstr: This methods binds the inputs which may be disconnected from a computation graph 
  (e.g., trainable parameters obtained by nn.get_parmaeters()) to actual inputs connected 
  to a given computation graph traversable from outputs
docstr_tok: ["This","methods","binds","the","inputs","which","may","be","disconnected","from","a","computation","graph","(","e.g.",",","trainable","parameters","obtained","by","nn.get_parmaeters","(",")",")","to","actual","inputs","connected","to","a","given","computation","graph","traversable","from","outputs"]
code: def _get_corresponding_vars_on_graph(self, inputs, outputs):
      """
      This methods binds the inputs which may be disconnected from a computation graph
      (e.g., trainable parameters obtained by nn.get_parmaeters()) to actual inputs connected
      to a given computation graph traversable from outputs
      """
      ret = [None for _ in range(len(inputs))]
      inp2id = {x: i for i, x in enumerate(inputs)}
  
      open = set()
  
      def dfs(node):
          if node in open or not node.parent:
              return
  
          for par_var in node.parent.inputs:
              if node in open:
                  continue
  
              id = inp2id.get(par_var, None)
              if id is not None:
                  ret[id] = par_var
  
              dfs(par_var)
              open.add(par_var)
  
      for output in outputs:
          dfs(output)
  
      return ret
  
imports: import numpy
  from collections import OrderedDict
  import nnabla
  import nnabla.functions
  from nnabla.function import PythonFunction
  from .backward_functions import registry
label_desc: Use image node_id 4 for calling the Grad obj's underlying member method code with example usage: obj._get_corresponding_vars_on_graph(inputs, outputs) and returns: ret