in your code , it’s for creating val and train set .
this is one way of spliting your dataset to train and val set.
if you set sampler to None, dataloader choose samples from all semple in your dataset.



 muhammedcanpirincci:

i want my program to select batch that doesnt have augmented image.


transform doesn’t  work this way by default . in most case dataset getitem applis transform to  single sample.
if you want , you can return both transfomed and orginal image in getitem and use one that you want.
def __getitem__(self, i):
        img , t = ...#load image and label
        return img ,self.transform(img),t