It’s one of my scripts
here’s the code
import torch
from torch.utils.data import Dataset
from data import data,labels
class cifar10(Dataset):
	def __init__(self,transforms):
		self.x = data
		self.y = labels
		self.transforms = transforms
	def __getitem__(self,idx):
		x = self.x[idx].transpose(1,2,0)
		y = self.y[idx]
		if self.transforms:
			x = self.transforms(x)
		return x,y
	def __len__(self):
		return len(self.x)