class_docstr: ### Transformer Layer
class_docstr_tok: ["#","#","#","Transformer","Layer"]
docstr: :param x: are the input embeddings of shape `[batch_size, height * width, d_model]`
  :param cond: is the conditional embeddings of shape `[batch_size,  n_cond, d_cond]`
docstr_tok: [":","param","x",":","are","the","input","embeddings","of","shape","`","[","batch_size",",","height","*","width",",","d_model","]","`",":","param","cond",":","is","the","conditional","embeddings","of","shape","`","[","batch_size",",","n_cond",",","d_cond","]","`"]
code: def forward(self, x: torch.Tensor, cond: torch.Tensor):
      """
      :param x: are the input embeddings of shape `[batch_size, height * width, d_model]`
      :param cond: is the conditional embeddings of shape `[batch_size,  n_cond, d_cond]`
      """
      # Self attention
      x = self.attn1(self.norm1(x)) + x
      # Cross-attention with conditioning
      x = self.attn2(self.norm2(x), cond=cond) + x
      # Feed-forward network
      x = self.ff(self.norm3(x)) + x
      #
      return x
  
imports: from typing import Optional
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 2 for calling the BasicTransformerBlock obj's underlying member method code with example usage: obj.forward(x, cond) and returns: x