code: def __init__(self, policy, config, model_config, layer_id, child):
      self.policy = policy
      self.config = config
      self.model_config = model_config
      self.layer_id = layer_id
      self.child = child
  
      self.megatron_v2 = self.policy.is_megatron_v2
      self.scale_attention = self.policy.scale_attention
      self.ckpt_load_enabled = False
  
      # configuration for models. todo: can this be moved to a pydantic model config?
      self.hidden_size = None
      self.intermediate_size = None
      self.num_attention_heads = None
      self.mp_size = self.config.tensor_parallel.tp_size
      self.pre_layer_norm = (
          self.model_config.do_layer_norm_before
          if hasattr(self.model_config, "do_layer_norm_before")
          else self.policy.pre_attn_norm
      )
      self.dtype = self.config.dtype
      self.attn_linear_layer = self.policy.linear_layer
      self.mlp_linear_layer = self.policy.linear_layer
      self.return_tuple = self.config.return_tuple
      self.triangular_masking = True
      self.local_attention = (
          (self.model_config.attention_layers[self.layer_id] == "local")
          if hasattr(self.model_config, "attention_layers")
          else False
      )
      self.window_size = getattr(self.model_config, "window_size", 1)
      self.mlp_act_func_type = self.policy.mlp_act_func_type
      self.norm_type = self.policy.norm_type
      self.training_mp_size = self.config.training_mp_size
      self.bigscience_bloom = False
      self.max_out_tokens = self.config.max_out_tokens
      self.min_out_tokens = self.config.min_out_tokens
      self.scale_attn_by_inverse_layer_idx = getattr(
          self.config, "scale_attn_by_inverse_layer_idx", False
      )
      self.use_mup = self.policy.use_mup
      self.return_single_tuple = False
      self.rotary_dim = self.get_rotary_dim()
      self.mlp_after_attn = (
          self.rotary_dim is None or self.rotary_dim < 0
      )
  
      # Attention tensors
      self.qkvw = None
      self.qkvb = None
      self.dense_w = None
      self.dense_b = None
      # MLP tensors
      self._h4h_w = None
      self._h4h_b = None
      self._4hh_w = None
      self._4hh_b = None
      # LayerNorm tensors
      self.attn_nw = None
      self.attn_nb = None
      self.input_nw = None
      self.input_nb = None
  
      self.mp_group = None
      self.use_triton = False
  
      # Triton
      self.use_triton = config.use_triton and deepspeed.HAS_TRITON
  
imports: from abc import ABC
  import torch
  import deepspeed
  from deepspeed.ops.transformer.inference.config import DeepSpeedInferenceConfig
  from deepspeed.accelerator import get_accelerator
label_desc: Use image node_id 1 to create a new BaseTransformerContainer object from inherited base classes: ABC with example: obj = BaseTransformerContainer(policy, config, model_config, layer_id, child)