arte/utils/gpu.py
def from_GPU(value, owner=None, quiet=False):
    '''
    If *value* is a cupy array, transfer it to the host
    and return the corresponding numpy array.

    All other values are left alone. It is safe to call
    this function with any kind of object, and also when
    cupy is not installed. In the latter case, of course
    no transfer will be done.
    '''
    if is_cupy_array(value):

        if not quiet:
            import cupy
            infostr = 'from_GPU: transferring %s %s' % (value.shape, value.dtype)
            infostr += ' from device %d' % cupy.cuda.runtime.getDevice()
            infostr += ' (owner %s)' % _format_owner(owner)
            print(infostr)
        return value.get()
    else:
        return value

    If *value* is a cupy array, transfer it to the host
    and return the corresponding numpy array.

    All other values are left alone. It is safe to call
    this function with any kind of object, and also when
    cupy is not installed. In the latter case, of course
    no transfer will be done.
    
If *value* is a cupy array, transfer it to the host
and return the corresponding numpy array.

All other values are left alone. It is safe to call
this function with any kind of object, and also when
cupy is not installed. In the latter case, of course
no transfer will be done.
If * value * is a cupy array transfer it to the host and return the corresponding numpy array . All other values are left alone . It is safe to call this function with any kind of object and also when cupy is not installed . In the latter case of course no transfer will be done .
def from_GPU(value, owner=None, quiet=False):
    if is_cupy_array(value):
        if not quiet:
            import cupy
            infostr = 'from_GPU: transferring %s %s' % (value.shape, value.dtype)
            infostr += ' from device %d' % cupy.cuda.runtime.getDevice()
            infostr += ' (owner %s)' % _format_owner(owner)
            print(infostr)
        return value.get()
    else:
        return value
def from_GPU ( value , owner = None , quiet = False ) : if is_cupy_array ( value ) : if not quiet : import cupy infostr = 'from_GPU: transferring %s %s' % ( value . shape , value . dtype ) infostr += ' from device %d' % cupy . cuda . runtime . getDevice ( ) infostr += ' (owner %s)' % _format_owner ( owner ) print ( infostr ) return value . get ( ) else : return value
If *value* is a cupy array, transfer it to the host
and return the corresponding numpy array.
If * value * is a cupy array transfer it to the host and return the corresponding numpy array .
'''
    If *value* is a cupy array, transfer it to the host
    and return the corresponding numpy array.

    All other values are left alone. It is safe to call
    this function with any kind of object, and also when
    cupy is not installed. In the latter case, of course
    no transfer will be done.
    '''
value
owner
quiet