Skip to content

Commit

Permalink
resize file_contents
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Jan 11, 2024
1 parent a6732b0 commit 8700607
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/api_cc/src/DeepPot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,9 @@ void DeepPotModelDevi::init(const std::vector<std::string>& models,
throw deepmd::deepmd_exception("no model is specified");
}
dps.resize(numb_models);
if (file_contents.size() != numb_models) {
file_contents.resize(numb_models);
}
for (unsigned int ii = 0; ii < numb_models; ++ii) {
dps[ii] = DeepPot(models[ii], gpu_rank, file_contents[ii]);
}
Expand Down

0 comments on commit 8700607

Please sign in to comment.