Fix For Requires Grad Infinite Loop (#18361)
authorElias Ellison <eellison@fb.com>
Sun, 24 Mar 2019 21:28:22 +0000 (14:28 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 24 Mar 2019 21:34:50 +0000 (14:34 -0700)
commitca962f0f95185e76b1f43a4423d28986ee0da191
tree3948e4816fc2b453dae0d64958c0419493a39e6c
parent92c9fef860fca1084f4219dfa1debdc920156418
Fix For Requires Grad Infinite Loop (#18361)

Summary:
Previously, we would continue to run requires grad on a loop body when the outputs and inputs disagreed. This adds a check so that we don't continue running if the results haven't changed since the last run.

Fix for https://github.com/pytorch/pytorch/issues/18320
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18361

Differential Revision: D14584332

Pulled By: eellison

fbshipit-source-id: 696b225f80a2036318540946428b525985a9e735
test/test_jit.py
torch/csrc/jit/passes/requires_grad_analysis.cpp
torch/csrc/jit/python_ir.cpp