[const_fold] Keep around node.meta for replaced folded ops (#64782)
authorJordan Fix <jfix@fb.com>
Fri, 10 Sep 2021 06:49:22 +0000 (23:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Sep 2021 06:52:39 +0000 (23:52 -0700)
commitbe091950d0b1407ef1beab55646c096ea6e75be0
tree99b416dad9f37b667b5c3f006239b521d6fc4a73
parent40098f48a1a37a06a456fd642d908ca522295706
[const_fold] Keep around node.meta for replaced folded ops (#64782)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64782

Previously, get_attrs that were added to the graph did not retain node.meta after folding. Add such support, and improve coverage in general here.

Test Plan: Added test coverage.

Reviewed By: protonu

Differential Revision: D30852704

fbshipit-source-id: ece87a61c69b2e68982964c6adc4dde14dae12c7
test/fx/test_fx_const_fold.py
torch/fx/experimental/const_fold.py