class_docstr: DNN Model
  Parameters
  ----------
  input_dim : int
      input dimension
  output_dim : int
      output dimension
  layers : tuple
      layer sizes
  lr : float
      learning rate
  optimizer : str
      optimizer name
  GPU : int
      the GPU ID used for training
class_docstr_tok: ["DNN","Model","Parameters","--","--","--","--","--","input_dim",":","int","input","dimension","output_dim",":","int","output","dimension","layers",":","tuple","layer","sizes","lr",":","float","learning","rate","optimizer",":","str","optimizer","name","GPU",":","int","the","GPU","ID","used","for","training"]
code: def use_gpu(self):
      return self.device != torch.device("cpu")
  
imports: from __future__ import division
  from __future__ import print_function
  from collections import defaultdict
  import os
  import gc
  import numpy
  import pandas
  from typing import Callable, Optional, Text, Union
  from sklearn.metrics import roc_auc_score, mean_squared_error
  import torch
  import torch.nn
  import torch.optim
  from .pytorch_utils import count_parameters
  from ...model.base import Model
  from ...data.dataset import DatasetH
  from ...data.dataset.handler import DataHandlerLP
  from ...data.dataset.weight import Reweighter
  from ...utils import auto_filter_kwargs, init_instance_by_config, unpack_archive_with_buffer, save_multiple_parts_file, get_or_create_path
  from ...log import get_module_logger
  from ...workflow import R
  from qlib.contrib.meta.data_selection.utils import ICLoss
  from torch.nn import DataParallel
label_desc: Use image node_id 2 for calling the DNNModelPytorch obj's underlying member method code with example usage: obj.use_gpu() and returns: unknown