mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Populate nn.module.stack in _fuse_conv_bn_qat for replacement nodes that correspond to a `get_attr` node in the original graph. In new training ir , `get_attr` nodes don't have `nn_module_stack` in node meta anymore (because the get_attr nodes are de-duplicated, so one get_attr node can potential have users in different module stacks). We populate it by checking if "conv_input" or "conv_weight" replacement node has nn_module_stack. If not, we copy it from the conv node. Test Plan: CI ``` buck run fbcode//caffe2/test:quantization_pt2e -- -r test_preserve_nn_module_stack ``` Differential Revision: D66393517 Pull Request resolved: https://github.com/pytorch/pytorch/pull/141400 Approved by: https://github.com/angelayi