Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
denghuilu committed Feb 14, 2022
1 parent a731e59 commit 22be0f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deepmd/descriptor/se_a.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def _filter_lower(
# we can safely return the final xyz_scatter filled with zero directly
return tf.cast(tf.fill((natom, 4, outputs_size[-1]), 0.), self.filter_precision)
# natom x nei_type_i x out_size
xyz_scatter = tf.cast(tf.reshape(xyz_scatter, (-1, shape_i[1]//4, outputs_size[-1])), self.filter_precision)
xyz_scatter = tf.reshape(xyz_scatter, (-1, shape_i[1]//4, outputs_size[-1]))
# When using tf.reshape(inputs_i, [-1, shape_i[1]//4, 4]) below
# [588 24] -> [588 6 4] correct
# but if sel is zero
Expand Down
16 changes: 8 additions & 8 deletions deepmd/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ def one_layer(inputs,
if use_timestep :
if mixed_prec is not None and not final_layer:
idt = tf.cast(idt, get_precision(mixed_prec['compute_prec']))
return tf.reshape(activation_fn(hidden), [-1, outputs_size]) * idt
hidden = tf.reshape(activation_fn(hidden), [-1, outputs_size]) * idt
else :
return tf.reshape(activation_fn(hidden), [-1, outputs_size])
else:
if useBN:
None
# return self._batch_norm(hidden, name=name+'_normalization', reuse=reuse)
else:
return hidden
hidden = tf.reshape(activation_fn(hidden), [-1, outputs_size])

if mixed_prec is not None:
hidden = tf.cast(hidden, get_precision(mixed_prec['output_prec']))
return hidden


def embedding_net_rand_seed_shift(
Expand Down Expand Up @@ -237,6 +235,8 @@ def embedding_net(xx,
xx = tf.concat([xx,xx], 1) + hidden
else:
xx = hidden
if mixed_prec is not None:
xx = tf.cast(xx, get_precision(mixed_prec['output_prec']))
return xx

def variable_summaries(var: tf.Variable, name: str):
Expand Down

0 comments on commit 22be0f5

Please sign in to comment.