code: def _move_tensor(tensor, new_device, name, config):
      device = str(tensor.device)
      if device == new_device:
          return tensor
      if config.gpu_peer_fix:
          if str(device).startswith("cuda:") and str(
              new_device
          ).startswith("cuda:"):
              tensor = tensor.to("cpu")
      return tensor.to(new_device)
  
imports: import sys
  import torch
  from torch import nn
  import torch.nn.functional
  from safetensors import safe_open
  import cuda_ext
  import json
  import math
  import gc
  from enum import Enum
label_desc: Use image node_id 4 for calling a global function with example usage: _move_tensor(tensor, new_device, name, config) and returns: tensor, tensor