def cuda_reshape(a, shape):
    """ Reshape a GPUArray.

    Parameters:
        a (gpu): GPUArray.
        shape (tuple): Dimension of new reshaped GPUArray.

    Returns:
        gpu: Reshaped GPUArray.

    Examples:
        >>> a = cuda_reshape(cuda_give([[1, 2], [3, 4]]), (4, 1))
        array([[ 1.],
               [ 2.],
               [ 3.],
               [ 4.]])
        >>> type(a)
        <class 'pycuda.gpuarray.GPUArray'>
    """
    return a.reshape(shape)