Skip to content

Commit c189b28

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a1330fa commit c189b28

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

deepmd/pt/utils/nlist.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ def build_neighbor_list(
112112

113113
# Create a version of coordinates where virtual atoms are replaced by xmax
114114
# This tensor will have shape [batch_size, nall, 3]
115-
vcoord_xyz = torch.where(
116-
is_vir[:, :, None], xmax, coord_xyz
117-
)
115+
vcoord_xyz = torch.where(is_vir[:, :, None], xmax, coord_xyz)
118116
# Original coord1 was:
119117
# coord1 = torch.where(
120118
# is_vir[:, :, None], xmax, coord.view(batch_size, nall, 3)
@@ -154,7 +152,7 @@ def build_neighbor_list(
154152
nnei = rr.shape[-1]
155153
# print(f"{nsel=}, {nnei=}")
156154
top_k = nsel if nsel <= nnei else nnei
157-
rr, nlist = torch.topk(rr, top_k+1, largest=False)
155+
rr, nlist = torch.topk(rr, top_k + 1, largest=False)
158156
# rr, nlist = torch.sort(rr, dim=-1) # FIXME
159157
# assert torch.allclose(rr, other=rr2[..., :top_k], atol=0)
160158

0 commit comments

Comments
 (0)