code: def static_forward_optimizations(func, inputs):
      """Perform checks needed for creation of a static schedule.
  
      Check if `func` supports static graph optimizations. If not,
      automatically wrap it to be compatible.
  
      This function is called from the `FunctionNode` apply() method
      in place of the original `func.forward(inputs)` call if
      `chainer.config.schedule_func` is not None.
  
      Args:
          func (instance of FunctionNode):
          inputs (tuple of ndarray): input arrays to `func`
  
      Returns:
          (tuple of ndarray): The outputs of the function.
      """
  
      schedule_function = chainer.config.schedule_func
      if not func._supports_static_optimizations:
          if schedule_function.verbosity_level >= 2:
              print(
                  "Adding automatic static graph support to "
                  "function: ",
                  func,
              )
  
          @static_code(func_name=str(func))
          def generic_static_forward(func, inputs):
              """Auto-wrap the supplied function.
  
              func (instance of FunctionNode): The function to include in
                  the static schedule.
              inputs (list of input arrays): The input arguments to `func`.
  
              Returns: a tuple of output arrays.
  
              """
              # Convert back to tuple because func.forward() requires it.
              in_data = tuple(inputs)
              ret = func.forward(in_data)
              return ret
  
          # Note: we convert inputs to a list because the API for
          # static_code requires it.
          return generic_static_forward(func, inputs=list(inputs))
      return func.forward(inputs)
  
label_desc: Use image node_id 2 for calling a global function with example usage: static_forward_optimizations(func, inputs) and returns: func, generic_static_forward, ret