class_docstr: A base class of objects with multi-device hierarchy.
docstr: Copies parameter variables and persistent values to GPU.
  
   .. deprecated:: v7.0.0
      Use :meth:`to_device` instead.
  
  This method does not handle non-registered attributes. If some of such
  attributes must be copied to GPU, the link implementation must
  override :meth:`~DeviceResident.device_resident_accept` to do so.
  
  .. warning::
  
      This method does not transfer the parameters if they are already on
      GPU. Use ``to_device`` to perform inter-GPU transfer.
  
  Args:
      device: Target device specifier. If omitted, the current device is
          used.
  
  Returns: self
docstr_tok: ["Copies","parameter","variables","and","persistent","values","to","GPU",".","..","deprecated",":",":","v7.0.0","Use",":","meth",":","`","to_device","`","instead",".","This","method","does","not","handle","non-registered","attributes",".","If","some","of","such","attributes","must","be","copied","to","GPU",",","the","link","implementation","must","override",":","meth",":","`","~DeviceResident.device_resident_accept","`","to","do","so",".","..","warning",":",":","This","method","does","not","transfer","the","parameters","if","they","are","already","on","GPU",".","Use","``","to_device","``","to","perform","inter-GPU","transfer",".","Args",":","device",":","Target","device","specifier",".","If","omitted",",","the","current","device","is","used",".","Returns",":","self"]
code: def to_gpu(
      self,
      device: tp.Optional[types.CudaDeviceSpec] = None,
  ) -> "DeviceResident":
      """Copies parameter variables and persistent values to GPU.
  
       .. deprecated:: v7.0.0
          Use :meth:`to_device` instead.
  
      This method does not handle non-registered attributes. If some of such
      attributes must be copied to GPU, the link implementation must
      override :meth:`~DeviceResident.device_resident_accept` to do so.
  
      .. warning::
  
          This method does not transfer the parameters if they are already on
          GPU. Use ``to_device`` to perform inter-GPU transfer.
  
      Args:
          device: Target device specifier. If omitted, the current device is
              used.
  
      Returns: self
  
      """
      cuda.check_cuda_available()
      cuda_device = cuda._get_device_or_current(device)
      device = chainer.backends.cuda.GpuDevice(cuda_device)
      visitor = _ToDeviceVisitor(
          device,
          entry_method_info=("to_gpu", {"device": device.device}),
          skip_between_cupy_devices=True,
          starting_device_resident=self,
      )
      self.__to_device(visitor)
      return self
  
imports: from __future__ import absolute_import
  import abc
  import sys
  import threading
  import typing
  import warnings
  import numpy
  import chainer
  from chainer import backend
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import types
  from chainer import utils
  import chainerx
label_desc: Use image node_id 6 for calling the DeviceResident obj's underlying member method code with example usage: obj.to_gpu(device) and returns: self