Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tf): prevent fitting_attr variable scope from becoming fitting_attr_1 #3930

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deepmd/tf/descriptor/se_a_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@
aparam[:, :] is the real/virtual sign for each atom.
"""
aparam = input_dict["aparam"]
with tf.variable_scope("fitting_attr" + suffix, reuse=reuse):
t_aparam_nall = tf.constant(True, name="aparam_nall", dtype=tf.bool)
t_aparam_nall = tf.constant(

Check warning on line 314 in deepmd/tf/descriptor/se_a_mask.py

View check run for this annotation

Codecov / codecov/patch

deepmd/tf/descriptor/se_a_mask.py#L314

Added line #L314 was not covered by tests

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable t_aparam_nall is not used.
True, name=f"fitting_attr{suffix}/aparam_nall", dtype=tf.bool
)
njzjz marked this conversation as resolved.
Show resolved Hide resolved
self.mask = tf.cast(aparam, tf.int32)
self.mask = tf.reshape(self.mask, [-1, natoms[1]])

Expand Down