class_docstr: ## Transformer Decoder Layer with DeepNorm
  
  This implements a transformer decoder layer with DeepNorm.
  Encoder layers will have a similar form.
class_docstr_tok: ["#","#","Transformer","Decoder","Layer","with","DeepNorm","This","implements","a","transformer","decoder","layer","with","DeepNorm",".","Encoder","layers","will","have","a","similar","form","."]
docstr: :param x: are the embeddings of shape `[seq_len, batch_size, d_model]`
docstr_tok: [":","param","x",":","are","the","embeddings","of","shape","`","[","seq_len",",","batch_size",",","d_model","]","`"]
code: def forward(self, x: torch.Tensor):
      """
      :param x: are the embeddings of shape `[seq_len, batch_size, d_model]`
      """
      # Create causal mask
      if self.mask is None or self.mask.size(0) != len(x):
          # Subsequent mask, will mask out tokens from seeing future tokens
          self.mask = subsequent_mask(len(x)).to(x.device)
  
      # Run through self attention, i.e. keys and values are from self
      x = self.self_attn_norm(
          x, self.self_attn(query=x, key=x, value=x, mask=self.mask)
      )
      # Pass through the feed-forward network
      x = self.feed_forward_norm(x, self.feed_forward(x))
  
      #
      return x
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/normalization/deep_norm/__init__.py
imports: from typing import Union, List
  import torch
  from torch import nn, Size
  from labml_nn.normalization.layer_norm import LayerNorm
  from labml_nn.transformers import MultiHeadAttention
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.utils import subsequent_mask
label_desc: Use image node_id 2 for calling the DeepNormTransformerLayer obj's underlying member method code with example usage: obj.forward(x) and returns: x