Note for anyone trying to do this in the future:
If you create a separate member variable in the dataset with the transforms, you can change that variable and just modify the __get_item__ method to have an expanded length and index
here’s a simple example:
class Dynamic_dataset(dataset):


    def __init__(
        self , data):
        

        self.orig_train_size = self.data.shape[0]
        
        self.transforms = []
     

    

    def add_transforms(self, transforms):
        self.transforms = transforms


    

    def __getitem__(self, index):
        """
        Args:
            index (int): Index
        Returns:
            tuple: (image, label) where target is class_index of the target class.
        """
        # For indexes past the original data, find from transforms
        if index >= self.orig_train_size:
                # Use the original data
                image, label = (
                    self.data[int(index % len(self.data))],
                    self.targets[int(index % len(self.data))],
                )
                image = torch.FloatTensor(image)
                pert_index = index - self.orig_train_size
                image = image + self.perturbations[pert_index]
                image = torch.clamp(image, 0.0, 1.0)
        else:
            image, label = self.data[index], self.targets[index]
            image = torch.FloatTensor(image)

        return image, label

    def __len__(self):
        return self.data.shape[0] + len(self.transforms)

You can access the method by
train_loader.dataset.add_transforms(transforms) (once you define your train_loader…)