[ONNX] Fix if output shape mismatch error & Fix graph input directly used as output (#53219) (#54865)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54865
Fix if output shape mismatch error & Fix graph input directly used as output
Test Plan: Imported from OSS
Reviewed By: nikithamalgifb
Differential Revision: D27408979
Pulled By: SplitInfinity
fbshipit-source-id: 4cfc7b8110b6cb73e000c9cf754190044fb5e1c0