arte/utils/gpu.py
def is_numpy_or_cupy_array(arr):
    '''Returns True if the argument is either a numpy or a cupy 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__')
Returns True if the argument is either a numpy or a cupy array

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

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