chainer.cuda.to_gpu¶
-
chainer.cuda.to_gpu(array, device=None, stream=None)[source]¶ Copies the given CPU array to the specified device.
Parameters: - array – Array to be sent to GPU.
- device – Device specifier.
- stream (Stream) – (deprecated since v3.0.0)
CUDA stream. If not
None, the copy runs asynchronously.
Returns: Array on GPU.
If
arrayis already on the GPU device specified bydevice, this function just returnsarraywithout performing any copy.Return type: