Skip to content

Commit

Permalink
replace tf.no_op (#1419)
Browse files Browse the repository at this point in the history
`tf.no_op` has a strange pefermance issue... We need to use another tensor as placeholder.

(cherry picked from commit f3b7189)
  • Loading branch information
njzjz committed Jan 15, 2022
1 parent e80e222 commit d7795ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/loss/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def build (self,
return l2_loss, more_loss

def eval(self, sess, feed_dict, natoms):
placeholder = tf.no_op()
placeholder = self.l2_l
run_data = [
self.l2_l,
self.l2_more['l2_ener_loss'] if self.has_e else placeholder,
Expand Down

0 comments on commit d7795ca

Please sign in to comment.