Skip to content

Commit

Permalink
fix se_e2_r prod_force_virial zero input
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Jul 27, 2024
1 parent dd56fe9 commit 4aa24ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/tf/descriptor/se_r.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,11 @@ def prod_force_virial(
"""
[net_deriv] = tf.gradients(atom_ener, self.descrpt_reshape)
tf.summary.histogram("net_derivative", net_deriv)
nf = tf.shape(self.nlist)[0]
net_deriv_reshape = tf.reshape(
net_deriv,
[
np.asarray(-1, dtype=np.int64),
nf,
natoms[0] * np.asarray(self.ndescrpt, dtype=np.int64),
],
)
Expand Down

0 comments on commit 4aa24ae

Please sign in to comment.