Skip to content

Commit

Permalink
[export] Copy gm before calling PassManager (pytorch#108321)
Browse files Browse the repository at this point in the history
  • Loading branch information
digantdesai authored and pytorchmergebot committed Aug 31, 2023
1 parent 31ef338 commit 691e0e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def _transform(self, *passes: PassType) -> "ExportedProgram":
)

pm = PassManager(list(passes))
res = pm(self.graph_module)
res = pm(copy.deepcopy(self.graph_module))
transformed_gm = res.graph_module if res is not None else self.graph_module
assert transformed_gm is not None

Expand Down

0 comments on commit 691e0e9

Please sign in to comment.