But i need to use .npz file, each npz file represent (X , label):
it’s correct like this ?
def npy_loader(path):
    with np.load(path) as train_data:
        train_examples=train_data['x']
        train_labels=train_data['y']
    X = torch.from_numpy(train_examples)
    Y = torch.from_numpy(train_labels)
    return X,Y
    

dataset = datasets.DatasetFolder(
    root='data/npz_file',
    loader=npy_loader,
    extensions='.npz'
)```