class_docstr: Device for GPU (CuPy) backend
class_docstr_tok: ["Device","for","GPU","(","CuPy",")","backend"]
docstr: Returns a :class:`~chainer.backend.GpuDevice` corresponding to the CUDA device ID.
          
docstr_tok: ["Returns","a",":","class",":","`","~chainer.backend.GpuDevice","`","corresponding","to","the","CUDA","device","ID","."]
code: def from_device_id(device_id):
      """Returns a :class:`~chainer.backend.GpuDevice` corresponding \
  to the CUDA device ID.
          """
      check_cuda_available()
  
      if not (isinstance(device_id, _integer_types) and device_id >= 0):
          raise ValueError(
              "Invalid CUDA device ID: {}".format(device_id)
          )
  
      return GpuDevice(Device(device_id))
  
imports: import binascii
  import functools
  import itertools
  import os
  import threading
  import time
  import typing
  import warnings
  import numpy
  import six
  import chainer
  from chainer import _backend
  from chainer.backends import _cpu
  from chainer.backends import intel64
  from chainer.configuration import config
  from chainer import types
  import chainerx
label_desc: Use image node_id 2 for calling the GpuDevice obj's underlying member method code with example usage: obj.from_device_id(device_id) and returns: GpuDevice