Skip to content

Commit

Permalink
use torch.logical_and
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Feb 26, 2024
1 parent 4606ab0 commit 51e5f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/utils/env_mat_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def iter(
).view(-1, 1),
)
# shape: (ntypes, nloc, nnei)
type_idx = (type_idx.unsqueeze(-1) * exclude_mask) == 1
type_idx = torch.logical_and(type_idx.unsqueeze(-1), exclude_mask)
for type_i in range(self.descriptor.get_ntypes()):
dd = env_mat[type_idx[type_i]]
dd = dd.reshape([-1, 4]) # typen_atoms * unmasked_nnei, 4
Expand Down

0 comments on commit 51e5f49

Please sign in to comment.