chainer.backend.ChainerxDevice

class chainer.backend.ChainerxDevice(device)[source]

Device for ChainerX backend

Methods

__enter__()[source]

A dummy definition that simply raises RuntimeError.

chainer.using_device() should be used instead.

__exit__(exc_type, exc_value, traceback)[source]

A dummy definition that should never be called.

create_context()[source]

Returns a context manager in which the device is made current.

See also

chainer.using_device() calls this method internally.

static from_array(array)[source]
static from_fallback_device(device)[source]

Returns a ChainerxDevice corresponding to the fallback device.

See also

fallback_device

send(arrays)[source]

Transfers given arrays to the device.

Parameters

arrays – Array or arrays of NumPy, CuPy, or ChainerX.

Returns

Transferred arrays.

send_array(array)[source]
use()[source]

Makes the device current in the current thread.

__eq__(other)[source]

Return self==value.

__ne__(other)[source]

Return self!=value.

__lt__()

Return self<value.

__le__()

Return self<=value.

__gt__()

Return self>value.

__ge__()

Return self>=value.

Attributes

fallback_device

Fallback device.

A fallback device is either a CpuDevice or a GpuDevice which shares the same physical device with the original ChainerX device.

For example, the fallback device of native:0 ChainerX device is CpuDevice. The fallback device of cuda:1 ChainerX device is GpuDevice with device ID 1.

supported_array_types

Array types supported by the device.

Returns

tuple of array types which the device’s module functions can handle.

xp

Array module corresponding to the device.