Better error for torch::jit::loading a eager file (#31709)

Summary:
This adds a check to catch the case where someone `torch.save`s something then `torch::jit::load`s it in C++.

Relevant for #31620
](https://our.intern.facebook.com/intern/diff/19252172/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31709

Pulled By: driazati

Differential Revision: D19252172

fbshipit-source-id: f2a9b4442647285418b2778306629b4ff77c15e5
This commit is contained in:
davidriazati
2020-01-07 16:19:01 -08:00
committed by Facebook Github Bot
parent a730920a3d
commit 3c07eb33bb
5 changed files with 56 additions and 0 deletions
+1
View File
@@ -21,6 +21,7 @@ TORCH_API void runJITCPPTests(bool runCuda) {
// and python test runners), but is instead invoked manually by the
// torch_python_test.cpp
testEvalModeForLoadedModule();
testTorchSaveError();
}
#undef JIT_TEST
#endif