code: def update_average(self, old, new):
      if old is None:
          return new
      return old * self.beta + (1 - self.beta) * new
  
imports: import copy
  import random
  from functools import wraps, partial
  import torch
  from torch import nn, einsum
  import torch.nn.functional
  from torchvision import transforms
  from einops import rearrange, reduce, repeat
label_desc: Use image node_id 2 for calling the EMA obj's underlying member method code with example usage: obj.update_average(old, new) and returns: unknown, new