Skip to content

Commit

Permalink
fix replace
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 19, 2023
1 parent f0d9346 commit 940389e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions deepmd/utils/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ def get_embedding_net_nodes_from_graph_def(
# embedding_net_pattern = f"filter_type_\d+{suffix}/matrix_\d+_\d+|filter_type_\d+{suffix}/bias_\d+_\d+|filter_type_\d+{suffix}/idt_\d+_\d+|filter_type_all{suffix}/matrix_\d+_\d+|filter_type_all{suffix}/matrix_\d+_\d+_\d+|filter_type_all{suffix}/bias_\d+_\d+|filter_type_all{suffix}/bias_\d+_\d+_\d+|filter_type_all{suffix}/idt_\d+_\d+"
if suffix != "":
embedding_net_pattern = (
EMBEDDING_NET_PATTERN.replace("/idt", suffix + "/idt")
.replace("/bias", suffix + "/bias")
.replace("/matrix", suffix + "/matrix")
EMBEDDING_NET_PATTERN.replace("/(idt)", suffix + "/(idt)")
.replace("/(bias)", suffix + "/(bias)")
.replace("/(matrix)", suffix + "/(matrix)")
)
else:
embedding_net_pattern = EMBEDDING_NET_PATTERN
Expand Down Expand Up @@ -275,9 +275,9 @@ def get_fitting_net_nodes_from_graph_def(
"""
if suffix != "":
fitting_net_pattern = (
FITTING_NET_PATTERN.replace("/idt", suffix + "/idt")
.replace("/bias", suffix + "/bias")
.replace("/matrix", suffix + "/matrix")
FITTING_NET_PATTERN.replace("/(idt)", suffix + "/(idt)")
.replace("/(bias)", suffix + "/(bias)")
.replace("/(matrix)", suffix + "/(matrix)")
)
else:
fitting_net_pattern = FITTING_NET_PATTERN
Expand Down

0 comments on commit 940389e

Please sign in to comment.