(filename)
Handles both numpy files and image formats.
Handles both numpy files and image formats.
Handles both numpy files and image formats .
def default_loader(filename):
    '''
    Handles both numpy files and image formats.
    '''
    if filename.endswith('.npy'):
        return numpy.load(filename).view(ndarray)
    elif filename.endswith('.npz'):
        return numpy.load(filename)
    else:
        return tv_default_loader(filename)
def default_loader ( filename ) : if filename . endswith ( '.npy' ) : return numpy . load ( filename ) . view ( ndarray ) elif filename . endswith ( '.npz' ) : return numpy . load ( filename ) else : return tv_default_loader ( filename )