Backend and Device

ChainerX adds a level of abstraction between the higher level array operations and the lower level computations and resource management. This abstraction is managed by the Backend and the Device classes. Native (CPU) and CUDA backends are two concrete implementations currently provided by ChainerX but the abstraction allows you to plug any backend into the framework.

Backend

chainerx.Backend

Pluggable entity that abstracts various computing platforms.

chainerx.get_backend

Returns a backend specified by the name.

Device

chainerx.Device

Represents a physical computing unit.

chainerx.get_device

Returns a device specified by the arguments.

chainerx.get_default_device

Returns the default device associated with the current thread.

chainerx.set_default_device

Sets the given device as the default device of the current thread.

chainerx.using_device

Creates a context manager to temporarily set the default device.