# Best practice to cache the entire dataset during first epoch

**URL:** <https://discuss.pytorch.org/t/best-practice-to-cache-the-entire-dataset-during-first-epoch/19608>\
**Category:** Uncategorized\
**Created:** [June 13, 2018, 6:52am UTC](https://discuss.pytorch.org/t/best-practice-to-cache-the-entire-dataset-during-first-epoch/19608 "2018-06-13T06:52:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![piotr](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/piotr/32/3727_2.png) [@piotr](https://discuss.pytorch.org/u/piotr)\
**Post date:** [December 22, 2022, 12:16pm UTC](https://discuss.pytorch.org/t/best-practice-to-cache-the-entire-dataset-during-first-epoch/19608/13 "2022-12-22T12:16:10Z")

</div>

Not sure what you referring to, but init usually is expected to be fast and shouldn’t load too much data, as it can create bugs in case of multiprocessing. see [How to share data among DataLoader processes to save memory](https://discuss.pytorch.org/t/how-to-share-data-among-dataloader-processes-to-save-memory/108772)

---

_[View the full topic](https://discuss.pytorch.org/t/best-practice-to-cache-the-entire-dataset-during-first-epoch/19608)._
