class_docstr: Maintains moving averages of model parameters using an exponential decay.
  ``ema_avg = decay * avg_model_param + (1 - decay) * model_param``
  `torch.optim.swa_utils.AveragedModel <https://pytorch.org/docs/stable/optim.html#custom-averaging-strategies>`_
  is used to compute the EMA.
class_docstr_tok: ["Maintains","moving","averages","of","model","parameters","using","an","exponential","decay",".","``","ema_avg","=","decay","*","avg_model_param","+","(","1","-","decay",")","*","model_param","``","`","torch.optim.swa_utils.AveragedModel","<","https",":","\/\/pytorch.org\/docs\/stable\/optim.html","#","custom-averaging-strategies",">","`","_","is","used","to","compute","the","EMA","."]
code: def __init__(self, model, decay, device="cpu"):
      def ema_avg(avg_model_param, model_param, num_averaged):
          return decay * avg_model_param + (1 - decay) * model_param
  
      super().__init__(model, device, ema_avg, use_buffers=True)
  
imports: import copy
  import datetime
  import errno
  import hashlib
  import os
  import time
  from collections import defaultdict, deque, OrderedDict
  from typing import List, Optional, Tuple
  import torch
  import torch.distributed
label_desc: Use image node_id 1 to create a new ExponentialMovingAverage object from inherited base classes: torch.optim.swa_utils with example: obj = ExponentialMovingAverage(model, decay, device)