code: def update(self, dict_data):
      ema_dict_data = {}
      for name, data in dict_data.items():
          data = data.view(1, -1)
          if self._updates == 0:
              previous_data = torch.zeros_like(data)
          else:
              previous_data = self.ema_data[name]
  
          ema_data = self.ema * previous_data + (1 - self.ema) * data
          if self._oneminusema_correction:
              # correction by 1/(1 - self.ema)
              # so that the gradients amplitude backpropagated in data is independent of self.ema
              ema_dict_data[name] = ema_data / (1 - self.ema)
          else:
              ema_dict_data[name] = ema_data
          self.ema_data[name] = ema_data.clone().detach()
  
      self._updates += 1
      return ema_dict_data
  
imports: import hashlib
  import operator
  import sys
  from collections import Counter
  from collections import OrderedDict
  from datetime import datetime
  from numbers import Number
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the MovingAverage obj's underlying member method code with example usage: obj.update(dict_data) and returns: ema_dict_data