dataset= dsets.CIFAR10(root='./cifar10/data/', transform=transform, train= True, download=True)
test_set= dsets.CIFAR10(root="./cifar10/data/", transform=transform, train= False)

def ZCA_whitening(X):
    X= X.reshape((-1, np.product(X.shape[1:])))
    X_centered= X - np.mean(X, axis= 0)
    Sigma= np.dot(X_centered.T, X_centered) / X_centered.shape[0]
    U, Lambda, _= np.linalg.svd(Sigma)
    W= np.dot(U, np.dot(np.diag(1.0/np.sqrt(Lambda + 1e-5)), U.T))
    
    X_ZCA= np.dot(X_centered, W.T)
    X_ZCA_rescaled = (X_ZCA - X_ZCA.min()) / (X_ZCA.max() - X_ZCA.min())
    return X_ZCA_rescaled

dataset_zca= ZCA_whitening(dataset.train_data)
test_set_zca= ZCA_whitening(test_set.test_data)

dataset_zca= torch.tensor(dataset_zca.reshape(-1,32,32,3))
test_set_zca= torch.tensor(test_set_zca.reshape(-1,32,32,3))

torch.Tensor(dataset.train_data)
torch.Tensor(test_set.test_data)
.
.
.
for idx, (data, target) in enumerate(loader):

Here it’s throwing error:  ’ object has no attribute 'array_interface"