Skip to content

Commit

Permalink
fix(pt): fix compute_output_stats_global when atomic_output is `N…
Browse files Browse the repository at this point in the history
…one` (#4155)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved error handling by ensuring that the output data is not `None`
before processing, preventing potential runtime errors.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
njzjz committed Sep 23, 2024
1 parent 6010c73 commit f5cfeab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def compute_output_stats_global(
std_atom_e = {}
for kk in keys:
if kk in stats_input:
if atomic_output.get_data()[kk].intensive:
if atomic_output is not None and atomic_output.get_data()[kk].intensive:
task_dim = stats_input[kk].shape[1]
assert merged_natoms[kk].shape == (nf[kk], ntypes)
stats_input[kk] = (
Expand Down

0 comments on commit f5cfeab

Please sign in to comment.