chainer.backend.get_device_from_array

chainer.backend.get_device_from_array(*arrays)[source]

Gets the device from arrays.

The device on which the given array reside is returned.

Note

Unlike get_array_module(), this method does not recognize Variable objects. If you need to get device from the Variable instance v, you need to use get_device_from_array(v.array).

Parameters

arrays (array or list of arrays) – Arrays to determine the device. If multiple arrays are given, the device correspoinding to the first array which is not NumPy array is returned.

Returns

Device instance.

Return type

chainer.backend.Device