class_docstr: Device for ChainerX backend
docstr: Returns a :class:`~chainer.backend.ChainerxDevice` corresponding to the fallback device.
  
  .. seealso::
      :data:`~chainer.backend.ChainerxDevice.fallback_device`
docstr_tok: ["Returns","a",":","class",":","`","~chainer.backend.ChainerxDevice","`","corresponding","to","the","fallback","device",".","..","seealso",":",":",":","data",":","`","~chainer.backend.ChainerxDevice.fallback_device","`"]
code: def from_fallback_device(device):
      """Returns a :class:`~chainer.backend.ChainerxDevice` corresponding \
  to the fallback device.
  
          .. seealso::
              :data:`~chainer.backend.ChainerxDevice.fallback_device`
          """
      assert isinstance(device, _backend.Device)
      if isinstance(device, _cpu.CpuDevice):
          return ChainerxDevice(chainerx.get_device("native", 0))
      if isinstance(device, cuda.GpuDevice):
          return ChainerxDevice(
              chainerx.get_device("cuda", device.device.id)
          )
      raise RuntimeError(
          "Only CPU or GPU devices are allowed. "
          "Actual: {}".format(device)
      )
  
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 3 for calling the ChainerxDevice obj's underlying member method code with example usage: obj.from_fallback_device(device) and returns: ChainerxDevice, ChainerxDevice