chainer.backend.Device¶
-
class
chainer.backend.
Device
[source]¶ A base class of unified devices.
Chainer has the following concrete implementations:
Methods
-
__enter__
()[source]¶ A dummy definition that simply raises RuntimeError.
chainer.using_device()
should be used instead.
-
create_context
()[source]¶ Returns a context manager in which the device is made current.
See also
chainer.using_device()
calls this method internally.
-
is_array_supported
(array)[source]¶ Returns if the specified array is compatible with the device. :param array: An array to be checked :type array: N-dimensional array
- Returns
True
if the array is compatible with the device. OtherwiseFalse
is returned.
-
send
(arrays)[source]¶ Transfers given arrays to the device.
- Parameters
arrays – Array or arrays of NumPy, CuPy, or ChainerX.
- Returns
Transferred arrays.
-
__lt__
()¶ Return self<value.
-
__le__
()¶ Return self<=value.
-
__gt__
()¶ Return self>value.
-
__ge__
()¶ Return self>=value.
Attributes
-
name
¶ A unique name of the device.
-
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.