Clean up related to type refinements (#62444)
Summary:
Creates a helper function to refine the types into a torchScript compatible format in the monkeytype config for profile directed typing
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62444
Reviewed By: malfet
Differential Revision: D30548159
Pulled By: nikithamalgifb
fbshipit-source-id: 7c09ce5f5e043d069313b87112837d7e226ade1f