def to_cpu(array, stream=None):
    if isinstance(array, ndarray):
        check_cuda_available()
        with get_device(array):
            return array.get(stream)
    elif isinstance(array, numpy.ndarray):
        return array
    else:
        raise TypeError(
            'The array sent to cpu must be numpy.ndarray or cupy.ndarray.'
            '\nActual type: {0}.'.format(type(array)))
Copies the given GPU array to host CPU.
dataset/ETHPy150Open pfnet/chainer/chainer/cuda.py/to_cpu