Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: se_r prod_env_mat #3351

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions deepmd/pt/utils/env_mat_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@
dtype=env.GLOBAL_PT_FLOAT_PRECISION,
device=env.DEVICE,
)
if self.last_dim == 4:
radial_only = False
elif self.last_dim == 1:
radial_only = True

Check warning on line 107 in deepmd/pt/utils/env_mat_stat.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/utils/env_mat_stat.py#L106-L107

Added lines #L106 - L107 were not covered by tests
else:
raise ValueError(

Check warning on line 109 in deepmd/pt/utils/env_mat_stat.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/utils/env_mat_stat.py#L109

Added line #L109 was not covered by tests
"last_dim should be 1 for raial-only or 4 for full descriptor."
)
anyangml marked this conversation as resolved.
Show resolved Hide resolved
for system in data:
coord, atype, box, natoms = (
system["coord"],
Expand Down Expand Up @@ -130,6 +138,7 @@
self.descriptor.get_rcut(),
# TODO: export rcut_smth from DescriptorBlock
self.descriptor.rcut_smth,
radial_only,
)
# reshape to nframes * nloc at the atom level,
# so nframes/mixed_type do not matter
Expand Down