Skip to content

Commit

Permalink
fix(pt): remove deprecating torch.norm (#4233)
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

- **Chores**
- Updated the normalization method for improved consistency and
potential optimization.
	- Minor code formatting adjustments for enhanced readability.
- Ensured compatibility with existing function calls by preserving
parameters and return types.

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

Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
wanghan-iapcm and Han Wang authored Oct 20, 2024
1 parent cc4b23d commit c2944eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/utils/nlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def extend_coord_with_ghosts(
xyz = xyz.view(-1, 3)
xyz = xyz.to(device=device, non_blocking=True)
# ns x 3
shift_idx = xyz[torch.argsort(torch.norm(xyz, dim=1))]
shift_idx = xyz[torch.argsort(torch.linalg.norm(xyz, dim=-1))]
ns, _ = shift_idx.shape
nall = ns * nloc
# nf x ns x 3
Expand Down

0 comments on commit c2944eb

Please sign in to comment.