Hi everybody,
I’m trying to learn how to use datasets form torchvision. Like written in the title, I want to filter a specific subset taken from FashonMNIST, dataset that I already splitted using random_split. the code that I written from now is this:
trainset_list = []
    trainloader_list = []

    # Define a transform to normalize the data
    transform = transforms.Compose([transforms.ToTensor(),
                                    transforms.Normalize((0.5,), (0.5,))])

    # Download and load the training data
    trainset = datasets.FashionMNIST('~/.pytorch/F_MNIST_data/', download=True, train=True, transform=transform)

    trainset_list = torch.utils.data.random_split(trainset, [int(len(trainset) / x) for _ in range(x)])
    
    for i_trainset in trainset_list:
        trainloader_list.append(torch.utils.data.DataLoader(i_trainset, batch_size=64, shuffle=True))


My idea was to write something like this after splitting the dataset in x, to remove class y from that portion of dataset:
    trainset_list[0].train_data = trainset_list[0].train_data[trainset_list[0].train_labels != y]
    trainset_list[0].train_labels = trainset_list[0].train_labels[trainset_list[0].train_labels != y]


Of course the code give me this error : ‘Subset’ object has no attribute ‘train_data’, because after splitting the dataset, each splitted part are now Subset.
How can I achieve  the filtering?