code: def test_shadow_params_updated(self):
      unet, ema_unet = self.get_models()
      # Here we simulate the parameter updates for `unet`. Since there might
      # be some parameters which are initialized to zero we take extra care to
      # initialize their values to something non-zero before the multiplication.
      unet_pseudo_updated_step_one = self.simulate_backprop(unet)
  
      # Take the EMA step.
      ema_unet.step(unet_pseudo_updated_step_one.parameters())
  
      # Now the EMA'd parameters won't be equal to the original model parameters.
      orig_params = list(unet_pseudo_updated_step_one.parameters())
      for s_param, param in zip(ema_unet.shadow_params, orig_params):
          assert ~torch.allclose(s_param, param)
  
      # Ensure this is the case when we take multiple EMA steps.
      for _ in range(4):
          ema_unet.step(unet.parameters())
      for s_param, param in zip(ema_unet.shadow_params, orig_params):
          assert ~torch.allclose(s_param, param)
  
file_path: llmga/llmga/diffusers/tests/others/test_ema.py
imports: import tempfile
  import unittest
  import torch
  from diffusers import UNet2DConditionModel
  from diffusers.training_utils import EMAModel
  from diffusers.utils.testing_utils import enable_full_determinism, skip_mps, torch_device
label_desc: Use image node_id 6 for calling the EMAModelTests obj's underlying member method code with example usage: obj.test_shadow_params_updated() without return types