Creating a dataset as a subset and then define data loaders. Assuming you only want labels 1 and 2

```
idx = torch.tensor(CIFAR10_train.targets) == 1
idx += torch.tensor(CIFAR10_train.targets) == 2
dset_train = torch.utils.data.dataset.Subset(CIFAR100_train, np.where(idx==1)[0])
idx = torch.tensor(CIFAR10_test.targets) == 1
idx += torch.tensor(CIFAR10_test.targets) == 2
dset_test = torch.utils.data.dataset.Subset(CIFAR100_test, np.where(idx==1)[0])
```

and dataloaders are defined as usual:

```
dl_train = torch.utils.data.DataLoader(dset_train, batch_size=8, shuffle=True)
dl_test = torch.utils.data.DataLoader(dset_test, batch_size=8, shuffle=True)
```