Add Pickler C++ API (#23241)
Summary:
This PR adds functions to wrap the Pickler and exposes them to the C++ API
](https://our.intern.facebook.com/intern/diff/16746451/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23241
Pulled By: driazati
Differential Revision: D16746451
fbshipit-source-id: 25ea5db4174006ce41e2e8989c8a345b82f637a7