make NamedType an interface (#24279)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24279
As title. I want to let children be able to define how to get their own
name
Test Plan: Imported from OSS
Differential Revision: D16800563
Pulled By: suo
fbshipit-source-id: 6a12ffef96b0dfa5543c5463386170de7726ad58