code: def recv_forward(
      tensor_shape: Shape,
      override_scatter_gather_tensors_in_pipeline: bool = False,
      *,
      dtype: Optional[torch.dtype] = None,
      async_comm: bool = False,
      sequence_parallel_enabled: bool = False,
      sync_batch_comm: bool = True,
      batch_p2p_comm: bool = True,
      timers: _Timers = None,
  ) -> Union[torch.Tensor, FutureTensor, None]:
      """Receive tensor from previous rank in pipeline (forward receive)."""
      if parallel_state.is_pipeline_first_stage():
          return None
      # if timers is not None:
      #     timers("forward-recv").start()
      input_tensor, _, _ = _communicate(
          tensor_send_next=None,
          tensor_send_prev=None,
          recv_prev=True,
          recv_next=False,
          tensor_shape=tensor_shape,
          override_scatter_gather_tensors_in_pipeline=override_scatter_gather_tensors_in_pipeline,
          dtype_=dtype,
          async_comm=async_comm,
          sequence_parallel_enabled=sequence_parallel_enabled,
          sync_batch_comm=sync_batch_comm,
          batch_p2p_comm=batch_p2p_comm,
      )
      # if timers is not None:
      #     timers("forward-recv").stop()
      return input_tensor
  
imports: from functools import reduce
  import operator
  from typing import Union, Optional, Tuple
  import torch
  from apex.transformer import parallel_state
  from apex.transformer.log_util import get_transformer_logger
  from apex.transformer.utils import split_tensor_into_1d_equal_chunks
  from apex.transformer.utils import gather_split_1d_tensor
  from apex.transformer.pipeline_parallel.utils import Shape
  from apex.transformer.pipeline_parallel._timers import _Timers
label_desc: Use image node_id 3 for calling a global function with example usage: recv_forward(tensor_shape, override_scatter_gather_tensors_in_pipeline) and returns: input_tensor, None