Getting the number of training examples from the loader

The number of examples is present from the dataset, not the dataloader.
So you can get the number of examples by using len(trainset)