code: def _build_device(self, config):
      seed = config["seed"]
      np.random.seed(seed)
      if not config["no_cuda"] and torch.cuda.is_available():
          print("[ Using CUDA ]")
          torch.manual_seed(seed)
          torch.cuda.manual_seed_all(seed)
          from torch.backends import cudnn
  
          cudnn.benchmark = True
          device = torch.device(
              "cuda" if config["gpu"] < 0 else "cuda:%d" % config["gpu"]
          )
      else:
          print("[ Using CPU ]")
          device = torch.device("cpu")
      self.device = device
  
file_path: graph4nlp/examples/pytorch/question_generation/inference.py
imports: import argparse
  import os
  from typing import List, Tuple
  import numpy
  import torch
  from nltk.tokenize import word_tokenize
  from graph4nlp.pytorch.data.dataset import DoubleText2TextDataItem, DoubleText2TextDataset
  from graph4nlp.pytorch.inference_wrapper.generator_inference_wrapper import GeneratorInferenceWrapper
  from graph4nlp.pytorch.modules.config import get_basic_args
  from graph4nlp.pytorch.modules.utils import constants
  from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config, update_values
  from .main import QGModel
label_desc: Use image node_id 2 for calling the ModelHandler obj's underlying member method code with example usage: obj._build_device(config) without return types