class_docstr: Back Translation with hugging-face translation models.
  A sentence can only be transformed into one sentence at most.
class_docstr_tok: ["Back","Translation","with","hugging-face","translation","models",".","A","sentence","can","only","be","transformed","into","one","sentence","at","most","."]
docstr: Get gpu or cpu device.
  
  :param str device: device string
                     "cpu" means use cpu device.
                     "cuda:0" means use gpu device which index is 0.
  :return: device in torch.
docstr_tok: ["Get","gpu","or","cpu","device",".",":","param","str","device",":","device","string","``","cpu","''","means","use","cpu","device",".","``","cuda:0","''","means","use","gpu","device","which","index","is","0.",":","return",":","device","in","torch","."]
code: def get_device(device):
      r"""
      Get gpu or cpu device.
  
      :param str device: device string
                         "cpu" means use cpu device.
                         "cuda:0" means use gpu device which index is 0.
      :return: device in torch.
  
      """
      if "cuda" not in device:
          return torch.device("cpu")
      else:
          return torch.device(device)
  
file_path: textflint/textflint/generation/transformation/UTCN/cn_back_trans.py
imports: import torch
  from ..transformation import Transformation
  from ....common import device
  from ....common.settings import CN_TRANS_FROM_MODEL, CN_TRANS_TO_MODEL
label_desc: Use image node_id 3 for calling the BackTrans obj's underlying member method code with example usage: obj.get_device(device) and returns: torch, torch