code: def get_ema_avg_fn(decay=0.999):
      @torch.no_grad()
      def ema_update(ema_param, current_param, num_averaged):
          return decay * ema_param + (1 - decay) * current_param
  
      return ema_update
  
imports: import itertools
  import math
  from copy import deepcopy
  import warnings
  import torch
  from torch.nn import Module
  from torch.optim.lr_scheduler import LRScheduler
  from torch.utils._foreach_utils import _get_foreach_kernels_supported_devices
  from torch.utils._foreach_utils import _group_tensors_by_device_and_dtype
label_desc: Use image node_id 3 for calling a global function with example usage: get_ema_avg_fn(decay) and returns: ema_update, unknown