arte/utils/gpu.py
def to_GPU(array, owner=None, quiet=False):
    '''
    Transfer *array* to the GPU and return the corresponding cupy array.
    '''
    if array is None:
        return array

    if not is_cupy_array(array):
        import cupy

        if not quiet:
            if is_numpy_array(array):
                infostr = 'to_GPU: transferring %s %s' % (array.shape, array.dtype)
            else:
                infostr = 'to_GPU: transferring object %s' % str(array)
            infostr += ' to device %d' % cupy.cuda.runtime.getDevice()
            infostr += ' (owner %s)' % _format_owner(owner)
            print(infostr)

        array = cupy.array(array)
    return array

    Transfer *array* to the GPU and return the corresponding cupy array.
    
Transfer *array* to the GPU and return the corresponding cupy array.
Transfer * array * to the GPU and return the corresponding cupy array .
def to_GPU(array, owner=None, quiet=False):
    if array is None:
        return array
    if not is_cupy_array(array):
        import cupy
        if not quiet:
            if is_numpy_array(array):
                infostr = 'to_GPU: transferring %s %s' % (array.shape, array.dtype)
            else:
                infostr = 'to_GPU: transferring object %s' % str(array)
            infostr += ' to device %d' % cupy.cuda.runtime.getDevice()
            infostr += ' (owner %s)' % _format_owner(owner)
            print(infostr)
        array = cupy.array(array)
    return array
def to_GPU ( array , owner = None , quiet = False ) : if array is None : return array if not is_cupy_array ( array ) : import cupy if not quiet : if is_numpy_array ( array ) : infostr = 'to_GPU: transferring %s %s' % ( array . shape , array . dtype ) else : infostr = 'to_GPU: transferring object %s' % str ( array ) infostr += ' to device %d' % cupy . cuda . runtime . getDevice ( ) infostr += ' (owner %s)' % _format_owner ( owner ) print ( infostr ) array = cupy . array ( array ) return array
Transfer *array* to the GPU and return the corresponding cupy array.
Transfer * array * to the GPU and return the corresponding cupy array .
'''
    Transfer *array* to the GPU and return the corresponding cupy array.
    '''
array
owner
quiet