Skip to content

Commit

Permalink
Fix: ZBL null test (#3447)
Browse files Browse the repository at this point in the history
This PR should address #3392 .

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
3 people authored Mar 11, 2024
1 parent b544885 commit 619fd1c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion deepmd/pt/model/atomic_model/linear_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def _compute_weight(
dim=-1,
) # handle masked nnei.

sigma = numerator / denominator # nfrmes, nloc
sigma = numerator / torch.clamp(denominator, 1e-20) # nfrmes, nloc
u = (sigma - self.sw_rmin) / (self.sw_rmax - self.sw_rmin)
coef = torch.zeros_like(u)
left_mask = sigma < self.sw_rmin
Expand Down
1 change: 0 additions & 1 deletion source/tests/pt/model/test_null_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def setUp(self):
self.model = get_model(model_params).to(env.DEVICE)


@unittest.skip("FAILED at the moment")
class TestEnergyModelZBL(unittest.TestCase, NullTest):
def setUp(self):
model_params = copy.deepcopy(model_zbl)
Expand Down

0 comments on commit 619fd1c

Please sign in to comment.