Back out "Revert D21089648: Put TORCH_LIBRARY in torch/library.h; add custom class API"
Summary: Original commit changeset: 636e8a11afc6
Test Plan: export to OSS
Reviewed By: malfet
Differential Revision: D21170502
fbshipit-source-id: e8f35f103c4924aedbcaaf868475008d24bdeeab