code: def convert_to_normal_tensor(
      tensor: torch.Tensor, orig_device: str
  ) -> torch.Tensor:
      """
      For some backends, such as NCCL, communication only works if the
      tensor is on the GPU. This converts the tensor back to original device.
      """
      if tensor.is_cuda and orig_device == "cpu":
          tensor = tensor.cpu()
      return tensor
  
imports: import io
  import tempfile
  from typing import Any, Callable, List, Tuple
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: convert_to_normal_tensor(tensor, orig_device) and returns: tensor