[ONNX] Add module name as PythonOp attribute (#67193) (#73281)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73281
* Add module name as pythonOp attr
* Move to trace_post_record
* Add tests
* Code compactness
Test Plan: Imported from OSS
Reviewed By: jbschlosser
Differential Revision: D34625647
Pulled By: malfet
fbshipit-source-id: b04b2a4f1dc2cf733fcf50a3b022337f80d6eead
(cherry picked from commit 56e8658974e0a5f7faab211d51b3e425886bff8a)