Move NamedType method definitions into cpp file (#21983)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21983
ghimport-source-id: fe9c1eba5f4c737e1442b877d396b9e8e5298cfb
Test Plan: Imported from OSS
Reviewed By: suo
Differential Revision: D15907633
Pulled By: jamesr66a
fbshipit-source-id: bd2dfdca117cdc3ae35fdd9d29cf521d82636069