[pytorch] split out trace type generator and migrate to new codegen model (#47438)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47438
Test Plan: Imported from OSS
Reviewed By: bhosmer
Differential Revision: D24808211
Pulled By: ljk53
fbshipit-source-id: 44dfadf550a255c05aa201e54b48101aaf722885