code: def send_forward_recv_backward(
      output_tensors: Union[
          torch.Tensor, List[Union[None, torch.Tensor]]
      ],
      tensor_shapes: List[Union[None, List[int]]],
      *,
      dtype: Optional[torch.dtype] = None,
      async_comm: bool = False,
      sequence_parallel_enabled: bool = False,
      sync_batch_comm: bool = True,
  ) -> List[Union[None, torch.Tensor, FutureTensor]]:
      if not isinstance(output_tensors, list):
          output_tensors = [output_tensors]
      output_tensor_grads = []
      for output_tensor, tensor_shape in zip(
          output_tensors, tensor_shapes
      ):
          if tensor_shape is None:
              output_tensor_grads.append(None)
              continue
          output_tensor_grad = (
              p2p_communication.send_forward_recv_backward(
                  output_tensor,
                  tensor_shape=tensor_shape,
                  dtype=dtype,
                  async_comm=async_comm,
                  sequence_parallel_enabled=sequence_parallel_enabled,
                  sync_batch_comm=sync_batch_comm,
              )
          )
          output_tensor_grads.append(output_tensor_grad)
      return output_tensor_grads
  
imports: import contextlib
  from typing import Any, List, Optional, Sequence, Union
  import warnings
  import torch
  from apex.transformer import parallel_state
  from apex.transformer.enums import ModelType
  from apex.transformer.pipeline_parallel import p2p_communication
  from apex.transformer.pipeline_parallel.p2p_communication import FutureTensor
  from apex.transformer.pipeline_parallel.utils import get_kth_microbatch
  from apex.transformer.pipeline_parallel.utils import listify_model
  from apex.transformer.pipeline_parallel.utils import get_num_microbatches
  from apex.transformer.pipeline_parallel.utils import get_model_type
  from apex.transformer.pipeline_parallel.schedules.common import Batch
  from apex.transformer.pipeline_parallel.schedules.common import FwdStepFunc
  from apex.transformer.pipeline_parallel.schedules.common import backward_step
  from apex.transformer.pipeline_parallel.schedules.common import forward_step
  from apex.transformer.pipeline_parallel.schedules.common import free_output_tensor
  from apex.transformer.log_util import get_transformer_logger
label_desc: Use image node_id 6 for calling a global function with example usage: send_forward_recv_backward(output_tensors, tensor_shapes) and returns: output_tensor_grads