While this approach might be faster for tiny datasets and small models, you are using your precious GPU memory to store all the data.
In my opinion the standard workflow is to save the GPU memory for your (large) model and to only push the current batch of data as needed. If tutorials teach you to push all data onto the GPU I would consider that an edge case (small data, small model).