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!

A Culinary Arts graduate intrigued by all kinds of data. Add me on linkedIn : https://www.linkedin.com/in/adityapat10/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store