copy methods when creating a derived class type (#24349)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24349
Methods that derive a new class type from the old one need to copy the
`method_` field as well as the attributes.
Test Plan: Imported from OSS
Differential Revision: D16825274
Pulled By: suo
fbshipit-source-id: 938334e0733d2a89f00ec46984cbd5beecb4c786