[JIT] Expose magic methods on script::Object (#38167)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/38167
Test Plan: Imported from OSS
Differential Revision: D21486709
Pulled By: jamesr66a
fbshipit-source-id: 17b44d979fc658768b0d64f7d8af6fb684043ea3