According to the release note, there are same different between nightly version and old version to load a model.
In the old version, the code is like this:
- std::shared_ptr<torch::jit::script::Module> model = torch::jit::load(“model.py”);
and now it change into :
- torch::jit::script::Module model = torch::jit::load(“model.py”);
and in the old version, i can use nullptr to check whether loading is successful:
- if (model == nullptr) std::cout << “failed to load model” << std::endl;
but how can i do this in the version after 1.2?
there have same problem when to release loaded model to load another one.
Can someone tell me how to do these, thanks.