Skip to content

Commit

Permalink
fix type_embed.py
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 7, 2024
1 parent 6ae7169 commit cc67fdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepmd/tf/utils/type_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Union,
)

import numpy as np

from deepmd.dpmodel.utils.network import (
EmbeddingNet,
)
Expand Down Expand Up @@ -327,7 +329,7 @@ def serialize(self, suffix: str = "") -> dict:
layer_idx = int(m[1]) - 1
weight_name = m[0]
if weight_name == "idt":
if value == 0.0:
if not isinstance(value, np.ndarray):
# ignore 0.0 set by deserialize
continue
value = value.ravel()
Expand Down

0 comments on commit cc67fdd

Please sign in to comment.