parameters: (self, executor, need_restore=True)
docstring: Apply moving average to parameters for evaluation.
          
          Args:
              executor (Executor): The Executor to execute applying.
              need_restore (bool, optional): Whether to restore parameters after 
                  applying. Default True.
docstring_summary: Apply moving average to parameters for evaluation.
          
          Args:
              executor (Executor): The Executor to execute applying.
              need_restore (bool, optional): Whether to restore parameters after 
                  applying. Default True.
docstring_tokens: Apply moving average to parameters for evaluation . Args : executor ( Executor ) : The Executor to execute applying . need_restore ( bool optional ) : Whether to restore parameters after applying . Default True .
function: def apply(self, executor, need_restore=True):
          """
          Apply moving average to parameters for evaluation.
          
          Args:
              executor (Executor): The Executor to execute applying.
              need_restore (bool, optional): Whether to restore parameters after 
                  applying. Default True.
          """
          executor.run(self.apply_program)
          try:
              yield
          finally:
              if need_restore:
                  self.restore(executor)
function_tokens: def apply ( self , executor , need_restore = True ) : executor . run ( self . apply_program ) try : yield finally : if need_restore : self . restore ( executor )