class_docstr: Exponential Weighted Average for Deep Neutal Networks
  Args:
      model (nn.Layer): Detector of model.
      decay (int):  The decay used for updating ema parameter.
          Ema's parameter are updated with the formula:
         `ema_param = decay * ema_param + (1 - decay) * cur_param`.
          Defaults is 0.9998.
      ema_decay_type (str): type in ['threshold', 'normal', 'exponential'],
          'threshold' as default.
      cycle_epoch (int): The epoch of interval to reset ema_param and
          step. Defaults is -1, which means not reset. Its function is to
          add a regular effect to ema, which is set according to experience
          and is effective when the total training epoch is large.
      ema_black_list (set|list|tuple, optional): The custom EMA black_list.
          Blacklist of weight names that will not participate in EMA
          calculation. Default: None.
class_docstr_tok: ["Exponential","Weighted","Average","for","Deep","Neutal","Networks","Args",":","model","(","nn.Layer",")",":","Detector","of","model",".","decay","(","int",")",":","The","decay","used","for","updating","ema","parameter",".","Ema","'s","parameter","are","updated","with","the","formula",":","`","ema_param","=","decay","*","ema_param","+","(","1","-","decay",")","*","cur_param","`",".","Defaults","is","0.9998.","ema_decay_type","(","str",")",":","type","in","[","'threshold","'",",","'normal","'",",","'exponential","'","]",",","'threshold","'","as","default",".","cycle_epoch","(","int",")",":","The","epoch","of","interval","to","reset","ema_param","and","step",".","Defaults","is","-1",",","which","means","not","reset",".","Its","function","is","to","add","a","regular","effect","to","ema",",","which","is","set","according","to","experience","and","is","effective","when","the","total","training","epoch","is","large",".","ema_black_list","(","set|list|tuple",",","optional",")",":","The","custom","EMA","black_list",".","Blacklist","of","weight","names","that","will","not","participate","in","EMA","calculation",".","Default",":","None","."]
code: def resume(self, state_dict, step=0):
      for k, v in state_dict.items():
          if k in self.state_dict:
              if self.state_dict[k].dtype == v.dtype:
                  self.state_dict[k] = v
              else:
                  self.state_dict[k] = v.astype(
                      self.state_dict[k].dtype
                  )
      self.step = step
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import weakref
  from copy import deepcopy
  from .utils import get_bn_running_state_names
label_desc: Use image node_id 3 for calling the ModelEMA obj's underlying member method code with example usage: obj.resume(state_dict, step) without return types