code: def update_ema_model(ema_model, model, step=0, decay=0.999):
      with paddle.no_grad():
          state = {}
          decay = min(1 - 1 / (step + 1), decay)
          msd = model.state_dict()
          for k, v in ema_model.state_dict().items():
              if paddle.is_floating_point(v):
                  v *= decay
                  v += (1.0 - decay) * msd[k].detach()
              state[k] = v
          ema_model.set_state_dict(state)
  
imports: import numpy
  import paddle
label_desc: Use image node_id 3 for calling a global function with example usage: update_ema_model(ema_model, model, step, decay) without return types