the train_loader and val_loader length are same as train_data length. But the train_sampler and val_sampler length are different is that possible?
    TRAIN_DATA_PATH = "./Dataset/Train"
    TEST_DATA_PATH = "./Dataset/Test"
    VALID_DATA_PATH = "./Dataset/Valid"
    BATCH_SIZE = 32

    TRANSFORM_IMG = transforms.Compose([transforms.Resize((224,224)),
    transforms.ToTensor(),transforms.Normalize(mean=[0.485, 0.456, 0.406],std=[0.229, 0.224, 0.225] )
    ])

    train_data = torchvision.datasets.ImageFolder(root=TRAIN_DATA_PATH, 
  transform=TRANSFORM_IMG)
    
    train_loader_all = data.DataLoader(train_data, batch_size=BATCH_SIZE, shuffle=True,  num_workers=4)

  
    validation_split = .3
    shuffle_dataset = True
    random_seed= 42

    # Creating data indices for training and validation splits:  
    dataset_size = len(train_loader_all.dataset)
    indices = list(range(dataset_size))
    split = int(np.floor(validation_split * dataset_size))
    if shuffle_dataset :
       np.random.seed(random_seed)
       np.random.shuffle(indices)
    train_indices, val_indices = indices[split:], indices[:split]

    # Creating PT data samplers and loaders:
    train_sampler = SubsetRandomSampler(train_indices)
    valid_sampler = SubsetRandomSampler(val_indices)
    print("leng:",len(train_sampler))
    print("leng:",len(valid_sampler))

    train_loader = torch.utils.data.DataLoader(train_data, batch_size=BATCH_SIZE,sampler=train_sampler)
    val_loader = torch.utils.data.DataLoader(train_data, batch_size=BATCH_SIZE,sampler=valid_sampler)
    
    print("val loader:",len(val_loader.dataset))
    print("train loader",len(train_loader.dataset))

this is the output

leng: 25970
leng: 11130
val loader: 37100
train loader 37100