class_docstr: Base class of modifiers.
  
  The `modify` method is called for a function with inputs in a graph topological order
  when you call the GraphConverter(<modifiers>).convert(<root variable>) method.
class_docstr_tok: ["Base","class","of","modifiers",".","The","`","modify","`","method","is","called","for","a","function","with","inputs","in","a","graph","topological","order","when","you","call","the","GraphConverter","(","<","modifiers",">",")",".convert","(","<","root","variable",">",")","method","."]
code: def __call__(self, f):
      # Init condition
      if not f.inputs[0].parent and f not in self._map_func_inputs:
          self._map_func_inputs[f] = self._copy_inputs(f.inputs)
  
      # Lookup
      inputs = self._map_func_inputs[f]
  
      if len(f.inputs) > 1:
          _inputs = [inp for inp in f.inputs]
          for i in range(len(inputs)):
              if not inputs[i]:  # i-th input var has not been saved
                  inputs[i] = _inputs[i]
  
      # Modify
      o = self.modify(f, inputs)
  
      if not isinstance(o, (type(None), nn.Variable)):
          raise ValueError("Return None or nn.Variable")
  
      # Modify as same
      if o is None:
          o = self._modify_as_same(f, inputs)
      outputs = self._force_list(o)
      self.outputs = outputs
  
      # Add next func and outputs (next funcs' inputs) to table
      for o0, o1 in zip(f.outputs, outputs):
          funcs = o0.function_references
          if funcs == []:
              return
          for func in funcs:
              if len(self._map_func_inputs[func]) == 0:  # init to None
                  self._map_func_inputs[func] = [None] * len(
                      func.inputs
                  )
              for i, inp in enumerate(func.inputs):
                  if o0 == inp:
                      self._map_func_inputs[func][i] = o1
  
imports: from collections import defaultdict
  import nnabla
  import nnabla.functions
label_desc: Use image node_id 6 for calling the FunctionModifier obj's underlying member method code with example usage: obj.__call__(f) without return types