Skip to content

Commit

Permalink
fix se_atten compression when suffix is given
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Jun 25, 2023
1 parent 089b1b1 commit 105086c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions deepmd/descriptor/se_atten.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,9 @@ def _get_two_side_embedding_net_variable(self, graph_def, varialbe_name, suffix)
for i in range(1, self.layer_size + 1):
target = get_pattern_nodes_from_graph_def(
graph_def,
f"filter_type_all{suffix}/{varialbe_name}_{i}{suffix}_two_side_ebd",
f"filter_type_all{suffix}/{varialbe_name}_{i}_two_side_ebd",
)
node = target[
f"filter_type_all{suffix}/{varialbe_name}_{i}{suffix}_two_side_ebd"
]
node = target[f"filter_type_all{suffix}/{varialbe_name}_{i}_two_side_ebd"]
ret["layer_" + str(i)] = node
return ret

Expand Down
4 changes: 2 additions & 2 deletions deepmd/utils/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def _get_bias(self):
bias["layer_" + str(layer)] = []
if isinstance(self.descrpt, deepmd.descriptor.DescrptSeAtten):
node = self.embedding_net_nodes[
f"filter_type_all{self.suffix}/bias_{layer}{self.suffix}"
f"filter_type_all{self.suffix}/bias_{layer}"
]
bias["layer_" + str(layer)].append(tf.make_ndarray(node))
elif isinstance(self.descrpt, deepmd.descriptor.DescrptSeA):
Expand Down Expand Up @@ -484,7 +484,7 @@ def _get_matrix(self):
matrix["layer_" + str(layer)] = []
if isinstance(self.descrpt, deepmd.descriptor.DescrptSeAtten):
node = self.embedding_net_nodes[
f"filter_type_all{self.suffix}/matrix_{layer}{self.suffix}"
f"filter_type_all{self.suffix}/matrix_{layer}"
]
matrix["layer_" + str(layer)].append(tf.make_ndarray(node))
elif isinstance(self.descrpt, deepmd.descriptor.DescrptSeA):
Expand Down

0 comments on commit 105086c

Please sign in to comment.