chainer.get_device(device_spec: Union[backend.Device, chainerx.Device, cuda.Device, str, Tuple[str, int], ModuleType, Tuple[ModuleType, int]]) chainer._backend.Device[source]

Returns a device object.


device_spec (object) –

Device specifier. If a chainer.backend.Device instance is given, it is returned intact. Otherwise the following values are supported:

  • ChainerX devices

    • A string representing a device. (ex. 'native:0', 'native')

    • A chainerx.Device object.

  • CuPy

  • NumPy

    • The string '@numpy'.

  • NumPy with Intel Architecture

    • The string '@intel64'.