code: def get_paddle_gpu_str(device: Union[str, int]) -> str:
      """
      获得 ``gpu:x`` 格式的设备名::
  
          >>> get_paddle_gpu_str(1)
          'gpu:1'
          >>> get_paddle_gpu_str("cuda:1")
          'gpu:1'
  
      :param device: 设备编号或设备名；
      :return: 对应的 ``gpu:x`` 格式的设备名；
      """
      if isinstance(device, str):
          return device.replace("cuda", "gpu")
      return f"gpu:{device}"
  
file_path: fastNLP/fastNLP/core/utils/paddle_utils.py
imports: import os
  import re
  from typing import Any, Optional, Union
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from fastNLP.envs import FASTNLP_DISTRIBUTED_CHECK, FASTNLP_BACKEND_LAUNCH, USER_CUDA_VISIBLE_DEVICES
  from .utils import apply_to_collection
label_desc: Use image node_id 3 for calling a global function with example usage: get_paddle_gpu_str(device) and returns: str, device, device