chainer.cuda.to_gpu¶
-
chainer.cuda.to_gpu(array, device=None, stream=None)[source]¶ Copies the given CPU array to specified device.
Parameters: - array – Array to be sent to GPU.
- device – Device specifier.
- stream (cupy.cuda.Stream) – CUDA stream. If not
None, the copy runs asynchronously.
Returns: Array on GPU.
If
arrayis already on GPU, then this function just returnsarraywithout performing any copy. Note that this function does not copycupy.ndarrayinto specified device.Return type: cupy.ndarray