Skip to content

Commit 4a0ca3e

Browse files
Yinghai LuWei Wei
authored andcommitted
Fix the FUSE_PASSES_POST_OBSERVER call (#81)
Summary: Pull Request resolved: https://github.com/pytorch/fx2trt/pull/81 The observer.observe calling signature is observe(module, inputs). But doing partial(observe, inputs) will reverse the order to observe(inputs, module). Fixing it by using an explicit lambda. Reviewed By: wushirong Differential Revision: D36638291 fbshipit-source-id: 64abc0952802d5b438e1013c5ff91a57442900d9
1 parent 134de54 commit 4a0ca3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fx/passes/lower_pass_manager_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def graph_optimization_pass(self) -> PassManager:
9696
for p in self.lower_setting.lower_basic_fuse_pass.passes:
9797
passes.append(wrapper(p, self._input))
9898
passes.append(
99-
inplace_wrapper(partial(FUSE_PASSES_POST_OBSERVER.observe, self._input))
99+
inplace_wrapper(lambda m: FUSE_PASSES_POST_OBSERVER.observe(m, self._input))
100100
)
101101

102102
return PassManager.build_from_passlist(passes)

0 commit comments

Comments
 (0)