Move functional graph creation to testing utils (#34916)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34916
Test Plan: Imported from OSS
Differential Revision: D20539337
Pulled By: eellison
fbshipit-source-id: 9b777e369facebbe68fe198ca3eec055cf9c5257