code: def __init__(self, sm_dim, lg_dim, depth, heads, dim_head, dropout):
      super().__init__()
      self.layers = nn.ModuleList([])
      for _ in range(depth):
          self.layers.append(
              nn.ModuleList(
                  [
                      ProjectInOut(
                          sm_dim,
                          lg_dim,
                          Attention(
                              lg_dim,
                              heads=heads,
                              dim_head=dim_head,
                              dropout=dropout,
                          ),
                      ),
                      ProjectInOut(
                          lg_dim,
                          sm_dim,
                          Attention(
                              sm_dim,
                              heads=heads,
                              dim_head=dim_head,
                              dropout=dropout,
                          ),
                      ),
                  ]
              )
          )
  
imports: import torch
  from torch import nn, einsum
  import torch.nn.functional
  from einops import rearrange, repeat
  from einops.layers.torch import Rearrange
label_desc: Use image node_id 1 to create a new CrossTransformer object from inherited base classes: nn with example: obj = CrossTransformer(sm_dim, lg_dim, depth, heads, dim_head, dropout)