Skip to content

Commit

Permalink
fix(pt): detach coord when building nlist in DPA-2 (#4387)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced memory optimization during computations in the descriptor
class.
- Streamlined selection parameter updates for improved clarity and
maintainability.
  
- **Bug Fixes**
- Retained error handling for input validation in parameter
initialization.

- **Documentation**
- Updated comments and documentation strings for better clarity on
methods and parameters.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Nov 21, 2024
1 parent ec6e903 commit c93dec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/model/descriptor/dpa2.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def forward(
nall = extended_coord.view(nframes, -1).shape[1] // 3
# nlists
nlist_dict = build_multiple_neighbor_list(
extended_coord,
extended_coord.detach(),
nlist,
self.rcut_list,
self.nsel_list,
Expand Down

0 comments on commit c93dec0

Please sign in to comment.