bing:

Also is this a better approach or not


It depends a bit on your use case.
You could save some data loading time, if you preload the data (e.g. images), process it all, and store it as binary data. However, since e.g. JPEG images are compressed, while binary data is usually not, you could potentially use more space on your device.
Also, in order to augment the data on the fly during training you would have to transform the samples back to images, if you want to use PIL.Image transforms, and then back again to tensors, so that your initial benefit might not be visible anymore.