chainer.backends.cuda.copy¶
-
chainer.backends.cuda.
copy
(array, out=None, out_device=None, stream=None)[source]¶ Copies a
cupy.ndarray
object using the default stream.This function can copy the device array to the destination array on another device.
- Parameters
array (cupy.ndarray) – Array to be copied.
out (cupy.ndarray) – Destination array. If it is not
None
, thenout_device
argument is ignored.out_device – Destination device specifier. Actual device object is obtained by passing this value to
get_device()
.stream (cupy.cuda.Stream) – CUDA stream.
- Returns
Copied array.
If
out
is not specified, then the array is allocated on the device specified byout_device
argument.- Return type