Hey Hiroshaan, thanks for your comment. Hope you enjoyed the tutorial.
As to your question, the probability of all the images from one class being selected in the training set is extremely unlikely, almost impossible.
Also see how I've used torch.manual_seed(). It sets a constant seed for random splitting, thus the produced test and train datasets would be similar across the board independent of any external factor.

Hope that helps. Let me know if any other query!