Revert "[export] Copy gm before calling PassManager" for test or build failures (#108441)

Test Plan: CI

Differential Revision: D48916322

Pull Request resolved: https://github.com/pytorch/pytorch/pull/108441
Approved by: https://github.com/cccclai
This commit is contained in:
Digant Desai 2023-09-05 19:21:01 +00:00 committed by PyTorch MergeBot
parent 0b44fdfaec
commit a9a6423261

View File

@ -399,7 +399,7 @@ class ExportedProgram:
)
pm = PassManager(list(passes))
res = pm(copy.deepcopy(self.graph_module))
res = pm(self.graph_module)
transformed_gm = res.graph_module if res is not None else self.graph_module
assert transformed_gm is not None