code: def forward(self, inputs):
      gpu = backend.get_array_module(*inputs) is cuda.cupy
      inputs = [cuda.to_cpu(x) for x in inputs]
  
      outputs = self.forward_func(*inputs)
  
      if gpu:
          # TODO(unno): We can remove redundant gpu-cpu copy using
          # theano.sandbox.cuda.CudaNdarray.gpudata
          device = cuda.get_device_from_array(inputs)
          outputs = [cuda.to_gpu(x, device) for x in outputs]
  
      return tuple(outputs)
  
file_path: chainer/chainer/functions/theano/theano_function.py
imports: import six
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function
  from chainer.utils import type_check
label_desc: Use image node_id 3 for calling the TheanoFunction obj's underlying member method code with example usage: obj.forward(inputs) and returns: tuple