[package] Modify Digraph to track predecessors (#61146)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61146
Track predecessors of nodes in DiGraph in order to enable cleaner dependency visualization code.
Test Plan: Imported from OSS
Reviewed By: suo
Differential Revision: D29559682
Pulled By: Lilyjjo
fbshipit-source-id: 06f51b1108423aece5bdd72a7b82ab736e5e4f94