Constant propagation changes (#16244)
authorElias Ellison <eellison@fb.com>
Thu, 24 Jan 2019 01:47:29 +0000 (17:47 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 24 Jan 2019 01:50:33 +0000 (17:50 -0800)
commit8710184eea6e20ad64c33f40cea584152bd8f3a7
tree203a646aea8a5cb28e33ba85588b3b6d3ccf669e
parent4b06c063a5259f50ec4c3cdde621857ea125fa97
Constant propagation changes (#16244)

Summary:
- remove loop node that is guaranteed not to execute
- remove extra loop outputs that are no longer needed

- if we are inlining an if node, only run constant propagation on the block that will execute

- remove the recurse argument since we only expose the Graph Constant Propagation and it's not used

This also includes  a few extra hooks to python_ir that I think make it a little be easier to test graph conditions from python.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16244

Differential Revision: D13791635

Pulled By: eellison

fbshipit-source-id: d16351fffcfc8013b02015db200f8fde002e0577
test/test_jit.py
torch/csrc/jit/passes/constant_propagation.cpp
torch/csrc/jit/python_ir.cpp