from torch.utils.data import Dataset from torch.utils.data import DataLoader from torch.utils.data import sampler import numpy as np import torch class OwnDataset(Dataset): def __init__(self,x,y): self.x = x self.y = y return def __getitem__(self,ind…