[DataPipe] Fix OOM when traverse IterDataPipe due to pickling (#72209)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72209
This PR would fix https://fburl.com/jtfyksyr
Test Plan: Imported from OSS
Reviewed By: dagitses, NivekT
Differential Revision: D33955933
Pulled By: ejguan
fbshipit-source-id: 120203a3c2323a0c7081715bb6628d1768f8b1c4
(cherry picked from commit 469f3d056276ad34c31dad4a3ba5c570f511854a)