Back out D17980308-D17980313 (#28748)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28748
Found D17980313 to break unit tests, backed out descendants too to avoid conflicts.
Test Plan:
Failed on master:
buck test mode/dev-nosan language_technology/neural_mt/fb/pytorch_translate/test:test_onnx
Passes with this diff.
Differential Revision: D18157588
fbshipit-source-id: e2b56eac8c5bfccf3ce9a3a2993f6332ab1471e7