Hy there, One way to perform transformation on both data and label is to write your own custom Dataset Class.

class CustomDataset(Dataset):
    def __init__(self , tensors , transform = None ):
        assert (tensor.size(0) == tensors[0].size(0) for tensor in tensors)
        self.tensors = tensors
        self.transform = transform
    def __getitem__(self,index):
        x = self.tensors[0][index]  
        y = self.tensors[1][index]
        if self.transform:
            x = self.transform(x) 
            y = self.transform(y)      
        return x , y

    def __len__(self):
        return len(self.tensors[0])  

# Flip tensor horizontally
def hflip(tensor):
    tensor = tensor.flip(2)
    return tensor

traindataset = CustomTensorDataset(tensors=(X_train, y_train), transform=vflip)