Skip to content

Commit

Permalink
fix codeql warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Mar 21, 2024
1 parent 4b80d99 commit 7261aa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion deepmd/tf/fit/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ def build(
inputs = tf.concat(
[tf.reshape(inputs, [-1, self.dim_descrpt]), atype_embed], axis=1
)
original_dim_descrpt = self.dim_descrpt
self.dim_descrpt = self.dim_descrpt + type_shape[1]

if not self.mixed_types:
Expand Down
3 changes: 3 additions & 0 deletions deepmd/tf/fit/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ def build(
)
else:
inputs_zero = tf.zeros_like(inputs, dtype=GLOBAL_TF_FLOAT_PRECISION)
else:
inputs_zero = None

if bias_atom_e is not None:
assert len(bias_atom_e) == self.ntypes
Expand Down Expand Up @@ -647,6 +649,7 @@ def build(
)
self.dim_descrpt = self.dim_descrpt + type_shape[1]
if len(self.atom_ener):
assert inputs_zero is not None
inputs_zero = tf.concat(
[tf.reshape(inputs_zero, [-1, original_dim_descrpt]), atype_embed],
axis=1,
Expand Down

0 comments on commit 7261aa4

Please sign in to comment.