Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 13, 2024
1 parent 7f09038 commit 32e6deb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deepmd/pt/loss/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ def forward(self, input_dict, model, label, natoms, learning_rate=0.0, mae=False
out_std = (
model.atomic_model.out_std[0][0]
if self.out_std is None
else torch.tensor(self.out_std, dtype=env.GLOBAL_PT_FLOAT_PRECISION, device=env.DEVICE)
else torch.tensor(
self.out_std, dtype=env.GLOBAL_PT_FLOAT_PRECISION, device=env.DEVICE
)
)
out_bias = (
model.atomic_model.out_bias[0][0]
if self.out_bias is None
else torch.tensor(self.out_bias, dtype=env.GLOBAL_PT_FLOAT_PRECISION, device=env.DEVICE)
else torch.tensor(
self.out_bias, dtype=env.GLOBAL_PT_FLOAT_PRECISION, device=env.DEVICE
)
)
assert len(out_std.shape) == 1
assert out_std.shape[0] == self.task_dim
Expand Down

0 comments on commit 32e6deb

Please sign in to comment.