class_docstr: A  layer wrapper for random LTD
class_docstr_tok: ["A","layer","wrapper","for","random","LTD"]
code: def init_config(self, config, scheduler, random_ltd_layer_id):
      self.random_ltd_scheduler = scheduler
      self.random_ltd_layer_id = random_ltd_layer_id
      self.max_length = self.random_ltd_scheduler.state[
          RANDOM_LTD_MAX_VALUE
      ]
  
      self.mask_name = config[RANDOM_LTD_MODEL_MASK_NAME]
      self.micro_bs = config[RANDOM_LTD_MICRO_BATCH_SIZE]
      self.random_ltd_num_layer = (
          self.random_ltd_scheduler.random_ltd_layer_num
      )
      hs_order = config[RANDOM_LTD_HIDDEN_STATE_ORDER]
      self.model_type = config[RANDOM_LTD_MODEL_TYPE]
  
      if hs_order == "batch_seq_dim":
          self.get_hidden_tensor_shape = self.get_bsh
          self.batch_first = True
      elif hs_order == "seq_batch_dim":
          self.get_hidden_tensor_shape = self.get_sbh
          self.batch_first = False
      else:
          logger.warning(
              "************For now, we only support batch_seq_dim or seq_batch_dim inputs. You can easily \
                       your own input dimension orders************"
          )
          raise NotImplementedError
  
      if self.model_type == "encoder":
          self.index_generator = bert_sample_tokens
      elif self.model_type == "decoder":
          self.index_generator = gpt_sample_tokens
      else:
          logger.warning(
              "************For now, we only support encoder-only or decoder-only models************"
          )
          raise NotImplementedError
  
file_path: DeepSpeed/deepspeed/runtime/data_pipeline/data_routing/basic_layer.py
imports: from deepspeed.utils import logger
  from torch import Tensor
  from torch.nn import Module
  from ..constants import *
  from deepspeed.ops.random_ltd.dropping_utils import gpt_sample_tokens, bert_sample_tokens, GatherTokens, ScatterTokens
label_desc: Use image node_id 2 for calling the RandomLayerTokenDrop obj's underlying member method code with example usage: obj.init_config(config, scheduler, random_ltd_layer_id) without return types