Skip to content

Commit

Permalink
Revert torch.fx.interpreter error printing change
Browse files Browse the repository at this point in the history
Apparently this is breaking internal peeps and I don't care enough
to keep it.

Signed-off-by: Edward Z. Yang <ezyang@meta.com>

[ghstack-poisoned]
  • Loading branch information
ezyang committed May 15, 2023
1 parent 9b6ccde commit 02e5823
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions torch/fx/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ def run(self, *args, initial_env : Optional[Dict[Node, Any]] = None, enable_io_p
self.env[node] = self.run_node(node)
except Exception as e:
if self.extra_traceback:
call_module_extra = ""
if node.op == "call_module":
call_module_extra = f" (module type: {type(getattr(self.module, node.target))})"
msg = f"While executing{call_module_extra} {node.format_node()}"
msg = f"While executing {node.format_node()}"
msg = '{}\n\n{}'.format(e.args[0], msg) if e.args else str(msg)
msg += f"\nOriginal traceback:\n{node.stack_trace}"
e.args = (msg,) + e.args[1:]
Expand Down

0 comments on commit 02e5823

Please sign in to comment.