arte/utils/gpu.py
def is_numpy_array(arr):
    '''Returns True if the argument is a numpy array.

    The check is performed looking at object attributes, therefore
    can be called without importing the cupy module.
    '''
    return hasattr(arr, '__array_function__') and \
           hasattr(arr, '__array_ufunc__') and \
           not hasattr(arr, 'device')
Returns True if the argument is a numpy array.

    The check is performed looking at object attributes, therefore
    can be called without importing the cupy module.
    
Returns True if the argument is a numpy array.
The check is performed looking at object attributes, therefore
can be called without importing the cupy module.
Returns True if the argument is a numpy array . The check is performed looking at object attributes therefore can be called without importing the cupy module .
def is_numpy_array(arr):
    return hasattr(arr, '__array_function__') and \
           hasattr(arr, '__array_ufunc__') and \
           not hasattr(arr, 'device')
def is_numpy_array ( arr ) : return hasattr ( arr , '__array_function__' ) and hasattr ( arr , '__array_ufunc__' ) and not hasattr ( arr , 'device' )
Returns True if the argument is a numpy array.
Returns True if the argument is a numpy array .
'''Returns True if the argument is a numpy array.

    The check is performed looking at object attributes, therefore
    can be called without importing the cupy module.
    '''
arr