class_docstr: Transforms an input by replacing its tokens with words of mask language
  predicted.
  To accelerate transformation for long text, input single sentence to
  language model rather than whole text.
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_mlm_suggestion.py
imports: import torch
  from ....common import device
  from ...transformation import CnWordSubstitute
  from ....common.settings import CN_BERT_MODEL_NAME
  from ....common.utils.list_op import trade_off_sub_words
label_desc: Use image node_id 3 for calling the MLMSuggestion obj's underlying member method code with example usage: obj.get_device(device) and returns: torch, torch