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 Nov 17, 2024
1 parent 6d4a6cd commit dee7c76
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,14 @@ def compute_output_stats_atomic(
}
# reshape outputs [nframes, nloc * ndim] --> reshape to [nframes * nloc, 1, ndim] for concatenation
# reshape natoms [nframes, nloc] --> reshape to [nframes * nolc, 1] for concatenation
natoms = {k: [sys_v.reshape(-1,1) for sys_v in v] for k, v in natoms.items()}
outputs = {k: [sys.reshape(natoms[k][sys_idx].shape[0], 1, -1) for sys_idx, sys in enumerate(v)] for k, v in outputs.items()}
natoms = {k: [sys_v.reshape(-1, 1) for sys_v in v] for k, v in natoms.items()}
outputs = {
k: [
sys.reshape(natoms[k][sys_idx].shape[0], 1, -1)
for sys_idx, sys in enumerate(v)
]
for k, v in outputs.items()
}

merged_output = {
kk: to_numpy_array(torch.cat(outputs[kk]))
Expand Down

0 comments on commit dee7c76

Please sign in to comment.