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 25, 2024
1 parent c561efe commit af5e589
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deepmd/pt/model/task/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
abstractmethod,
)
from typing import (
Callable,
Optional,
Union,
Callable,
)

import numpy as np
Expand Down Expand Up @@ -440,7 +440,7 @@ def compute_input_stats(
sampled = merged

Check warning on line 440 in deepmd/pt/model/task/fitting.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/fitting.py#L440

Added line #L440 was not covered by tests
# stat fparam
if self.numb_fparam > 0:
cat_data = torch.cat([frame["fparam"] for frame in sampled],dim=0)
cat_data = torch.cat([frame["fparam"] for frame in sampled], dim=0)
cat_data = torch.reshape(cat_data, [-1, self.numb_fparam])
fparam_avg = torch.mean(cat_data, axis=0)
fparam_std = torch.std(cat_data, axis=0)
Expand All @@ -449,7 +449,9 @@ def compute_input_stats(
torch.tensor(fparam_avg, device=env.DEVICE, dtype=self.fparam_avg.dtype)
)
self.fparam_inv_std.copy_(
torch.tensor(fparam_inv_std, device=env.DEVICE, dtype=self.fparam_inv_std.dtype)
torch.tensor(
fparam_inv_std, device=env.DEVICE, dtype=self.fparam_inv_std.dtype
)
)
# TODO: stat aparam

Expand Down

0 comments on commit af5e589

Please sign in to comment.