class_docstr: Transformer class.
class_docstr_tok: ["Transformer","class","."]
docstr: Set input tensor to be used instead of forward()'s input.
  
  When doing pipeline parallelism the input from the previous
  stage comes from communication, not from the input, so the
  model's forward_step_func won't have it. This function is thus
  used by internal code to bypass the input provided by the
  forward_step_func
code: def set_input_tensor(self, input_tensor):
      """Set input tensor to be used instead of forward()'s input.
  
      When doing pipeline parallelism the input from the previous
      stage comes from communication, not from the input, so the
      model's forward_step_func won't have it. This function is thus
      used by internal code to bypass the input provided by the
      forward_step_func"""
      self.input_tensor = input_tensor
  
imports: from contextlib import nullcontext
  from typing import Any, Callable, Optional
  import torch
  import torch.nn
  from einops import rearrange
  from nemo.collections.common.parts.adapter_modules import LinearAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, ParallelLinearAdapterConfig, ParallelLinearAdapterWeightTyingConfig
  from nemo.collections.nlp.modules.common.megatron.attention import ParallelAttention, ParallelChunkedCrossAttention
  from nemo.collections.nlp.modules.common.megatron.fused_bias_dropout_add import bias_dropout_add, bias_dropout_add_fused_inference, bias_dropout_add_fused_train, dropout_add
  from nemo.collections.nlp.modules.common.megatron.fused_layer_norm import get_layer_norm
  from nemo.collections.nlp.modules.common.megatron.layer_norm_1p import LayerNorm1P, LPLayerNorm
  from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.mlp import ParallelMLP, SwitchMLP
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.collections.nlp.parts import utils_funcs
  from nemo.core import adapter_mixins
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the ParallelTransformer obj's underlying member method code with example usage: obj.set_input_tensor(input_tensor) without return types