class_docstr: Transformer language model.
  
  Args:
      config (TransformerConfig): transformer config
      num_tokentypes (int) : Set to 2 when args.bert_binary_head is True, and 0 otherwise. Defaults to 0.
      transformer_layer_spec (ModuleSpec): Specifies module to use for transformer layers
      vocab_size (int): vocabulary size
      max_sequence_length (int): maximum size of sequence. This is used for positional embedding
      pre_process (bool): Include embedding layer (used with pipeline parallelism)
      post_process (bool): Include an output layer (used with pipeline parallelism)
      parallel_output (bool): Do not gather the outputs, keep them split across tensor parallel ranks
      share_embeddings_and_output_weights (bool): When True, input embeddings and output logit weights are shared. Defaults to False.
      position_embedding_type (string): Position embedding type. Options ['learned_absolute', 'rope'].
          Defaults is 'learned_absolute'.
      rotary_percent (float): Percent of rotary dimension to use for rotary position embeddings.
          Defaults to 1.0 (100%). Ignored unless position_embedding_type is 'rope'.
docstr: Sets input tensor to the model.
  
  See megatron.model.transformer.set_input_tensor()
  
  Args:
      input_tensor (Tensor): Sets the input tensor for the model.
docstr_tok: ["Sets","input","tensor","to","the","model",".","See","megatron.model.transformer.set_input_tensor","(",")","Args",":","input_tensor","(","Tensor",")",":","Sets","the","input","tensor","for","the","model","."]
code: def set_input_tensor(self, input_tensor: Tensor) -> None:
      """Sets input tensor to the model.
  
      See megatron.model.transformer.set_input_tensor()
  
      Args:
          input_tensor (Tensor): Sets the input tensor for the model.
      """
      # This is usually handled in schedules.py but some inference code still
      # gives us non-lists or None
      if not isinstance(input_tensor, list):
          input_tensor = [input_tensor]
  
      assert (
          len(input_tensor) == 1
      ), "input_tensor should only be length 1 for gpt/bert"
      self.encoder.set_input_tensor(input_tensor[0])
  
imports: from typing import Literal, Optional
  import torch
  from torch import Tensor
  from megatron.core.models.bert.bert_lm_head import BertLMHead
  from megatron.core.models.bert.pooler import Pooler
  from megatron.core.models.common.embeddings.language_model_embedding import LanguageModelEmbedding
  from megatron.core.models.common.embeddings.rotary_pos_embedding import RotaryEmbedding
  from megatron.core.models.common.language_module.language_module import LanguageModule
  from megatron.core.transformer.enums import AttnMaskType, ModelType
  from megatron.core.transformer.spec_utils import ModuleSpec
  from megatron.core.transformer.transformer_block import TransformerBlock
  from megatron.core.transformer.transformer_config import TransformerConfig
  from megatron.core.transformer.utils import get_linear_layer
label_desc: Use image node_id 4 for calling the BertModel obj's underlying member method code with example usage: obj.set_input_tensor(input_tensor) without return types