Skip to content

Commit

Permalink
Revert torch.fx.interpreter error printing change (#101462)
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>
Pull Request resolved: #101462
Approved by: https://github.com/wushirong, https://github.com/ngimel, https://github.com/voznesenskym
  • Loading branch information
ezyang authored and pytorchmergebot committed May 16, 2023
1 parent 799ef7e commit d198033
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 d198033

Please sign in to comment.