class_docstr: ### Transformer Layer
class_docstr_tok: ["#","#","#","Transformer","Layer"]
docstr: :param d_model: is the input embedding size
  :param n_heads: is the number of attention heads
  :param d_head: is the size of a attention head
  :param d_cond: is the size of the conditional embeddings
docstr_tok: [":","param","d_model",":","is","the","input","embedding","size",":","param","n_heads",":","is","the","number","of","attention","heads",":","param","d_head",":","is","the","size","of","a","attention","head",":","param","d_cond",":","is","the","size","of","the","conditional","embeddings"]
code: def __init__(
      self, d_model: int, n_heads: int, d_head: int, d_cond: int
  ):
      """
      :param d_model: is the input embedding size
      :param n_heads: is the number of attention heads
      :param d_head: is the size of a attention head
      :param d_cond: is the size of the conditional embeddings
      """
      super().__init__()
      # Self-attention layer and pre-norm layer
      self.attn1 = CrossAttention(d_model, d_model, n_heads, d_head)
      self.norm1 = nn.LayerNorm(d_model)
      # Cross attention layer and pre-norm layer
      self.attn2 = CrossAttention(d_model, d_cond, n_heads, d_head)
      self.norm2 = nn.LayerNorm(d_model)
      # Feed-forward network and pre-norm layer
      self.ff = FeedForward(d_model)
      self.norm3 = nn.LayerNorm(d_model)
  
imports: from typing import Optional
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 to create a new BasicTransformerBlock object from inherited base classes: nn with example: obj = BasicTransformerBlock(d_model, n_heads, d_head, d_cond)