Skip to content

Commit

Permalink
fix shape
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Jul 22, 2024
1 parent fa94e8e commit 29c1b58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepmd/pt/model/model/spin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ def process_spin_output_lower(
)
if add_mag:
extended_out_real = extended_out_real + extended_out_mag
shape2 = 1
for ss in extended_out_tensor.shape[2:]:
shape2 *= ss

Check warning on line 172 in deepmd/pt/model/model/spin_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/spin_model.py#L170-L172

Added lines #L170 - L172 were not covered by tests
extended_out_mag = (
extended_out_mag.view([nframes, nall, -1]) * atomic_mask
extended_out_mag.view([nframes, nall, shape2]) * atomic_mask
).view(extended_out_mag.shape)
return extended_out_real, extended_out_mag, atomic_mask > 0.0

Expand Down

0 comments on commit 29c1b58

Please sign in to comment.