Revert "Revert D21089648: Put TORCH_LIBRARY in torch/library.h; add custom class API" (#37019)
Summary:
This reverts commit 2ccdc39dce91a1821ede9bfdea26b30d66e1554f.
Original PR: https://github.com/pytorch/pytorch/pull/36742
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37019
Differential Revision: D21161361
Pulled By: ezyang
fbshipit-source-id: dca4192d3f7be25a34bbe3d57ddce3afc1c2558c