class_docstr: ## Compressive Transformer Model
  
  This consists of multiple compressive transformer layers
docstr: * `x` is a tensor of the token embeddings vectors of shape `[seq_len, batch_size, d_model]`
  * `mem` is a list of tensors of the past token level feature vectors of shape
   `[mem_len, batch_size, d_model]` for each layer
  * `c_mem` is a list of tensors of the compressed memory
   `[c_mem_len, batch_size, d_model]` for each layer
  * `mask` is the masking matrix
docstr_tok: ["*","`","x","`","is","a","tensor","of","the","token","embeddings","vectors","of","shape","`","[","seq_len",",","batch_size",",","d_model","]","`","*","`","mem","`","is","a","list","of","tensors","of","the","past","token","level","feature","vectors","of","shape","`","[","mem_len",",","batch_size",",","d_model","]","`","for","each","layer","*","`","c_mem","`","is","a","list","of","tensors","of","the","compressed","memory","`","[","c_mem_len",",","batch_size",",","d_model","]","`","for","each","layer","*","`","mask","`","is","the","masking","matrix"]
code: def forward(
      self,
      x: torch.Tensor,
      mem: List[torch.Tensor],
      c_mem: List[torch.Tensor],
      mask: torch.Tensor,
  ):
      """
      * `x` is a tensor of the token embeddings vectors of shape `[seq_len, batch_size, d_model]`
      * `mem` is a list of tensors of the past token level feature vectors of shape
       `[mem_len, batch_size, d_model]` for each layer
      * `c_mem` is a list of tensors of the compressed memory
       `[c_mem_len, batch_size, d_model]` for each layer
      * `mask` is the masking matrix
      """
      # List to store token level feature vectors,
      # which will become the memories for the next sequential batch.
      new_mem = []
      # Run through each transformer layer
      for i, layer in enumerate(self.layers):
          # Add to the list of feature vectors
          new_mem.append(x.detach())
          # Memory
          m = mem[i] if mem else None
          # Compressed Memory
          cm = c_mem[i] if c_mem else None
          # Run through the transformer XL layer
          x = layer(x=x, mem=m, c_mem=cm, mask=mask)
      # Finally, normalize the vectors
      return self.norm(x), new_mem
  
imports: from typing import Optional, List
  import torch
  import torch.nn.functional
  from torch import nn
  from labml_helpers.module import Module, TypedModuleList
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.mha import PrepareForMultiHeadAttention
  from labml_nn.transformers.xl.relative_mha import RelativeMultiHeadAttention
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 2 for calling the CompressiveTransformer obj's underlying member method code with example usage: obj.forward(x, mem, c_mem, mask) and returns: self,  new_mem