Skip to content

Commit

Permalink
do not save none
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed May 28, 2024
1 parent cedaca8 commit 0bcd410
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deepmd/pt/utils/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def serialize_from_file(model_file: str) -> dict:
"pt_version": torch.__version__,
"model": model_dict,
"model_def_script": model_def_script,
"@variables": {
"min_nbor_dist": model.get_min_nbor_dist(),
},
"@variables": {},
}
if model.get_min_nbor_dist() is not None:
data["@variables"]["min_nbor_dist"] = model.get_min_nbor_dist()
return data


Expand Down

0 comments on commit 0bcd410

Please sign in to comment.