code: def test_loading_motion_adapter(self):
      model = self.model_class()
      adapter = MotionAdapter()
      model.load_motion_modules(adapter)
  
      for idx, down_block in enumerate(model.down_blocks):
          adapter_state_dict = adapter.down_blocks[
              idx
          ].motion_modules.state_dict()
          for (
              param_name,
              param_value,
          ) in down_block.motion_modules.named_parameters():
              self.assertTrue(
                  torch.equal(
                      adapter_state_dict[param_name], param_value
                  )
              )
  
      for idx, up_block in enumerate(model.up_blocks):
          adapter_state_dict = adapter.up_blocks[
              idx
          ].motion_modules.state_dict()
          for (
              param_name,
              param_value,
          ) in up_block.motion_modules.named_parameters():
              self.assertTrue(
                  torch.equal(
                      adapter_state_dict[param_name], param_value
                  )
              )
  
      mid_block_adapter_state_dict = (
          adapter.mid_block.motion_modules.state_dict()
      )
      for (
          param_name,
          param_value,
      ) in model.mid_block.motion_modules.named_parameters():
          self.assertTrue(
              torch.equal(
                  mid_block_adapter_state_dict[param_name], param_value
              )
          )
  
imports: import copy
  import os
  import tempfile
  import unittest
  import numpy
  import torch
  from diffusers import MotionAdapter, UNet2DConditionModel, UNetMotionModel
  from diffusers.utils import logging
  from diffusers.utils.import_utils import is_xformers_available
  from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, torch_device
  from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
label_desc: Use image node_id 7 for calling the UNetMotionModelTests obj's underlying member method code with example usage: obj.test_loading_motion_adapter() without return types