Fix fuse_parallel_linear (#76202)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76202
move legalize_graph to a common tool class.
Reviewed By: yinghai, jfix71, 842974287
Differential Revision: D35694145
fbshipit-source-id: b044df3b46b3029c383581f7853a4338c2b13c62
(cherry picked from commit 49884d557d220f981f5f894bdcd381df749e3efb)