[tools_common] Don't remove underscores from call_module targets in get_acc_ops_name (#72664)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72664
Test Plan: CI.
Reviewed By: wushirong
Differential Revision: D34148357
fbshipit-source-id: 9c75aaeae59461d7550fb00c6f98c879e98274f6
(cherry picked from commit 553525698aaee02737ff36e096f4dafeb143d5da)
diff --git a/torch/fx/passes/tools_common.py b/torch/fx/passes/tools_common.py
index f673e47..0054d74 100644
--- a/torch/fx/passes/tools_common.py
+++ b/torch/fx/passes/tools_common.py
@@ -23,7 +23,7 @@
return f"acc_ops.{k.__name__}"
else:
module = k.__module__
- return f"{module if module else ''}.{k.__name__}".replace('_', '')
+ return f"{module if module else ''}.{k.__name__}"
@compatibility(is_backward_compatible=False)