class_docstr: Transformer with extra features.
  
  This module is the backbone of `FTTransformer`.
class_docstr_tok: ["Transformer","with","extra","features",".","This","module","is","the","backbone","of","`","FTTransformer","`","."]
code: def _get_kv_compressions(self, layer):
      return (
          (self.shared_kv_compression, self.shared_kv_compression)
          if self.shared_kv_compression is not None
          else (layer["key_compression"], layer["value_compression"])
          if "key_compression" in layer and "value_compression" in layer
          else (layer["key_compression"], layer["key_compression"])
          if "key_compression" in layer
          else (None, None)
      )
  
imports: import enum
  import math
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union, cast
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from .utils import init_weights
label_desc: Use image node_id 2 for calling the Custom_Transformer obj's underlying member method code with example usage: obj._get_kv_compressions(layer) and returns: unknown