Skip to content

Commit afc4c38

Browse files
committed
fix serialize
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
1 parent 95aef5d commit afc4c38

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

deepmd/tf/model/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,10 @@ def serialize(self, suffix: str = "") -> dict:
900900

901901
ntypes = len(self.get_type_map())
902902
dict_fit = self.fitting.serialize(suffix=suffix)
903-
if dict_fit.get("@variables", {}).get("bias_atom_e") is not None:
903+
if (
904+
dict_fit.get("@variables", {}).get("bias_atom_e") is not None
905+
and dict_fit["dim_out"] == dict_fit["embedding_width"]
906+
):
904907
out_bias = dict_fit["@variables"]["bias_atom_e"].reshape(
905908
[1, ntypes, dict_fit["dim_out"]]
906909
)

0 commit comments

Comments
 (0)