class_docstr: Averaging function for EMA with configurable decay rate
  (Supplementary '1.11.7 Evaluator setup').
class_docstr_tok: ["Averaging","function","for","EMA","with","configurable","decay","rate","(","Supplementary","'","1.11.7","Evaluator","setup","'",")","."]
code: def __call__(
      self,
      averaged_model_parameter: torch.Tensor,
      model_parameter: torch.Tensor,
      num_averaged: torch.Tensor,
  ) -> torch.Tensor:
      # for decay_rate = 0.999:
      # return averaged_model_parameter * 0.999 + model_parameter * 0.001
      # avg * 0.999 + m * 0.001
      # 999*avg/1000 + m/1000
      # (999*avg + avg - avg)/1000 + m/1000
      # (1000*avg - avg)/1000 + m/1000
      # 1000*avg/1000 - avg/1000 + m/1000
      # avg + (m - avg)/1000
      # avg + (m - avg)*0.001
      return averaged_model_parameter + (
          model_parameter - averaged_model_parameter
      ) * (1.0 - self._decay_rate)
  
file_path: apex/apex/contrib/test/openfold_triton/test_fused_adam_swa.py
imports: from itertools import chain
  import random
  import unittest
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the swa_avg_fn obj's underlying member method code with example usage: obj.__call__(averaged_model_parameter, model_parameter, num_averaged) and returns: unknown