class_docstr: Device for ChainerX backend
docstr: Fallback device.
  
  A fallback device is either a :class:`~chainer.backend.CpuDevice` or
  a :class:`~chainer.backend.GpuDevice` which shares the same physical
  device with the original ChainerX device.
  
  For example, the fallback device of ``native:0`` ChainerX device is
  :class:`~chainer.backend.CpuDevice`. The fallback device of ``cuda:1``
  ChainerX device is :class:`~chainer.backend.GpuDevice` with device ID
  1.
docstr_tok: ["Fallback","device",".","A","fallback","device","is","either","a",":","class",":","`","~chainer.backend.CpuDevice","`","or","a",":","class",":","`","~chainer.backend.GpuDevice","`","which","shares","the","same","physical","device","with","the","original","ChainerX","device",".","For","example",",","the","fallback","device","of","``","native:0","``","ChainerX","device","is",":","class",":","`","~chainer.backend.CpuDevice","`",".","The","fallback","device","of","``","cuda:1","``","ChainerX","device","is",":","class",":","`","~chainer.backend.GpuDevice","`","with","device","ID","1","."]
code: def fallback_device(self):
      """Fallback device.
  
      A fallback device is either a :class:`~chainer.backend.CpuDevice` or
      a :class:`~chainer.backend.GpuDevice` which shares the same physical
      device with the original ChainerX device.
  
      For example, the fallback device of ``native:0`` ChainerX device is
      :class:`~chainer.backend.CpuDevice`. The fallback device of ``cuda:1``
      ChainerX device is :class:`~chainer.backend.GpuDevice` with device ID
      1.
      """
      backend_name = self.device.backend.name
      if backend_name == "native":
          return _cpu.CpuDevice()
      if backend_name == "cuda":
          return cuda.GpuDevice.from_device_id(self.device.index)
      raise RuntimeError(
          "Only 'native' or 'cuda' devices have corresponding fallback "
          "devices. Actual: {}".format(backend_name)
      )
  
imports: import numpy
  import chainer
  from chainer import _backend
  from chainer.backends import _cpu
  from chainer.backends import cuda
  from chainer.backends import intel64
  import chainerx
label_desc: Use image node_id 5 for calling the ChainerxDevice obj's underlying member method code with example usage: obj.fallback_device() and returns: _cpu, cuda