Skip to content

Commit e9796e1

Browse files
tugsbayasgalanfacebook-github-bot
authored andcommitted
Use nn_module_stack instead
Summary: I don't know why source_fn_stack is disappeared but i think relying on nn_module_stack is better Differential Revision: D85959415
1 parent 1e473ed commit e9796e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchao/quantization/pt2e/qat_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ def _fold_conv_bn_qat(m: GraphModule) -> GraphModule:
888888
and node.args[0].op == "get_attr"
889889
and node.args[1] == 1
890890
and torch.nn.modules.batchnorm.BatchNorm2d
891-
in [val[1] for val in node.meta["source_fn_stack"]]
891+
in [val[1] for _, val in node.meta["nn_module_stack"].items()]
892892
):
893893
m.graph.erase_node(node)
894894

0 commit comments

Comments
 (0)