Remove StopGradient op when it is inplace in inference (#12152)
Summary:
For Inference, if the StopGradient op is inpalce, we just remove it.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12152
Differential Revision: D13633946
Pulled By: yinghai
fbshipit-source-id: 57762bcc37b38a1d39cb4af316ca50bfe961b105