pickler.cpp: respect __getstate__/__setstate__
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23190
Test Plan: Imported from OSS
Differential Revision: D16431553
Pulled By: zdevito
fbshipit-source-id: 680ea1507c12727fd17aedb3067f522cf490e306