code: def test_spatial_transformer_ada_norm_layers(self):
      spatial_transformer_block = Transformer2DModel(
          num_attention_heads=1,
          attention_head_dim=32,
          in_channels=32,
          num_embeds_ada_norm=5,
      )
  
      assert (
          spatial_transformer_block.transformer_blocks[
              0
          ].norm1.__class__
          == AdaLayerNorm
      )
      assert (
          spatial_transformer_block.transformer_blocks[
              0
          ].norm3.__class__
          == nn.LayerNorm
      )
  
imports: import unittest
  import numpy
  import torch
  from torch import nn
  from diffusers.models.attention import GEGLU, AdaLayerNorm, ApproximateGELU
  from diffusers.models.embeddings import get_timestep_embedding
  from diffusers.models.lora import LoRACompatibleLinear
  from diffusers.models.resnet import Downsample2D, ResnetBlock2D, Upsample2D
  from diffusers.models.transformer_2d import Transformer2DModel
  from diffusers.utils.testing_utils import torch_device
label_desc: Use image node_id 7 for calling the Transformer2DModelTests obj's underlying member method code with example usage: obj.test_spatial_transformer_ada_norm_layers() without return types