code: def set_device(self, use_gpu=False):
      if use_gpu == False:
          if not self.cpu_have_loaded:
              exe = paddle.static.Executor(paddle.CPUPlace())
              [
                  prog,
                  inputs,
                  outputs,
              ] = paddle.static.load_inference_model(
                  path_prefix=self.pretrained_model,
                  executor=exe,
                  model_filename="model.pdmodel",
                  params_filename="model.pdiparams",
              )
              (
                  self.cpuexec,
                  self.cpuprog,
                  self.cpuinputs,
                  self.cpuoutputs,
              ) = (exe, prog, inputs, outputs)
              self.cpu_have_loaded = True
  
          return (
              self.cpuexec,
              self.cpuprog,
              self.cpuinputs,
              self.cpuoutputs,
          )
  
      else:
          if not self.gpu_have_loaded:
              exe = paddle.static.Executor(paddle.CUDAPlace(0))
              [
                  prog,
                  inputs,
                  outputs,
              ] = paddle.static.load_inference_model(
                  path_prefix=self.pretrained_model,
                  executor=exe,
                  model_filename="model.pdmodel",
                  params_filename="model.pdiparams",
              )
              (
                  self.gpuexec,
                  self.gpuprog,
                  self.gpuinputs,
                  self.gpuoutputs,
              ) = (exe, prog, inputs, outputs)
              self.gpu_have_loaded = True
  
          return (
              self.gpuexec,
              self.gpuprog,
              self.gpuinputs,
              self.gpuoutputs,
          )
  
file_path: PaddleHub/modules/image/image_processing/seeinthedark/module.py
imports: import os
  import argparse
  import paddle
  import paddlehub
  from paddlehub.module.module import moduleinfo, runnable, serving
  import numpy
  import rawpy
  import cv2
  from .util import base64_to_cv2
label_desc: Use image node_id 2 for calling the LearningToSeeInDark obj's underlying member method code with example usage: obj.set_device(use_gpu) and returns: self,  self,  self,  self, self,  self,  self,  self