Skip to content

Commit a08285f

Browse files
Bycobmergify[bot]
authored andcommitted
fix(torch): add error message when repository contains multiple models
1 parent cbee659 commit a08285f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backends/torch/torchmodule.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ namespace dd
470470

471471
void TorchModule::load(TorchModel &model)
472472
{
473+
if (!model._native.empty() && !model._proto.empty())
474+
{
475+
throw MLLibBadParamException(
476+
"Found both native and graph model in repository");
477+
}
478+
473479
if (!model._traced.empty() && model._proto.empty())
474480
traced_model_load(model);
475481

0 commit comments

Comments
 (0)