Skip to content

Commit

Permalink
fix(torch/native): prevent loading weights before instanciating nativ…
Browse files Browse the repository at this point in the history
…e model
  • Loading branch information
fantes authored and sileht committed Oct 21, 2020
1 parent 77a016b commit b15d767
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backends/torch/torchlib.cc
Expand Up @@ -196,7 +196,8 @@ namespace dd

void TorchModule::native_model_load(const TorchModel &tmodel)
{
if (!tmodel._native.empty())
if (!tmodel._native.empty()
&& _native != nullptr) //_native has to be instanciated before loading
{
_logger->info("loading " + tmodel._native);
try
Expand Down

0 comments on commit b15d767

Please sign in to comment.