[ONNX] Update inputs/input_names formatting to avoid ValueError with scriptMethods (#53519) (#53548)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53548
fixes issue faced in #53506
Test Plan: Imported from OSS
Reviewed By: SplitInfinity
Differential Revision: D26922415
Pulled By: malfet
fbshipit-source-id: b61842827bb14cef8c7a7089b2426fa53e642c90