So after creating the class I created the object called trainset as
trainset = Cifar500(path = "./data",transforms = transform)

Then I am checking the number of samples as
len(trainset.data)

which returns 50,000(not 5,000).
I created the trainloader with the trainset as
trainloader = torch.utils.data.DataLoader(trainset, batch_size =32 ,shuffle=True, num_workers=2)

And
trainloader.dataset

prints
Dataset Cifar500
    Number of datapoints: 5000
    Root location: ./data
    Split: Train
    Compose(
    ToTensor()
    Normalize(mean=(0.4914, 0.4822, 0.4465), std=(0.2023, 0.1994, 0.201))
)

(5000 datapoints)
I am not able to understand which actually is being fed to the network 5000 datapoints or 50,000 samples.