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","."]
docstr: Modify the function.
  
  Implement this method in a sub class to modify a function.
  
  Examples:
  
  .. code-block:: python
  
     class ReLUToLeakyReLUModifier(FunctionModifier):
  
       def __init__(self):
         super(ReLUToLeakyReLUModifier, self).__init__()
  
       def modify(self, f, inputs):
         if f.info.type_name == 'ReLU':
           x = inputs[0]
           return F.leaky_relu(x)
  
  This examples is a simple case since the network topological order does not change.
  In GraphConverter, we expect the modify method is called along
  the original network topological order not the modified order.
  In such a complex case, see themodify method of :obj:`BatchNormalizationFoldingModifierInner`
  as a reference.
  
  Args:
    f (:obj:`nnabla.function.Function`): NNabla function object.
    inputs (list of :obj:`Variable`): New inputs to `f`. This may be modified one or the same as f.inputs.
  
  Returns:
    :obj:`Variable` or list of :obj:`Variable`.
docstr_tok: ["Modify","the","function",".","Implement","this","method","in","a","sub","class","to","modify","a","function",".","Examples",":","..","code-block",":",":","python","class","ReLUToLeakyReLUModifier","(","FunctionModifier",")",":","def","__init__","(","self",")",":","super","(","ReLUToLeakyReLUModifier",",","self",")",".__init__","(",")","def","modify","(","self",",","f",",","inputs",")",":","if","f.info.type_name","==","'ReLU","'",":","x","=","inputs","[","0","]","return","F.leaky_relu","(","x",")","This","examples","is","a","simple","case","since","the","network","topological","order","does","not","change",".","In","GraphConverter",",","we","expect","the","modify","method","is","called","along","the","original","network","topological","order","not","the","modified","order",".","In","such","a","complex","case",",","see","themodify","method","of",":","obj",":","`","BatchNormalizationFoldingModifierInner","`","as","a","reference",".","Args",":","f","(",":","obj",":","`","nnabla.function.Function","`",")",":","NNabla","function","object",".","inputs","(","list","of",":","obj",":","`","Variable","`",")",":","New","inputs","to","`","f","`",".","This","may","be","modified","one","or","the","same","as","f.inputs",".","Returns",":",":","obj",":","`","Variable","`","or","list","of",":","obj",":","`","Variable","`","."]
code: def modify(self, f, inputs):
      """Modify the function.
  
      Implement this method in a sub class to modify a function.
  
      Examples:
  
      .. code-block:: python
  
         class ReLUToLeakyReLUModifier(FunctionModifier):
  
           def __init__(self):
             super(ReLUToLeakyReLUModifier, self).__init__()
  
           def modify(self, f, inputs):
             if f.info.type_name == 'ReLU':
               x = inputs[0]
               return F.leaky_relu(x)
  
      This examples is a simple case since the network topological order does not change.
      In GraphConverter, we expect the modify method is called along
      the original network topological order not the modified order.
      In such a complex case, see themodify method of :obj:`BatchNormalizationFoldingModifierInner`
      as a reference.
  
      Args:
        f (:obj:`nnabla.function.Function`): NNabla function object.
        inputs (list of :obj:`Variable`): New inputs to `f`. This may be modified one or the same as f.inputs.
  
      Returns:
        :obj:`Variable` or list of :obj:`Variable`.
      """
      pass
  
imports: from collections import defaultdict
  import nnabla
  import nnabla.functions
label_desc: Use image node_id 7 for calling the FunctionModifier obj's underlying member method code with example usage: obj.modify(f, inputs) without return types