Skip to content

Commit e48497c

Browse files
author
Han Wang
committed
fix: add missing accessor methods to DescrptBlockRepformers
The env_mat_stat code calls descriptor.get_rcut_smth() and descriptor.get_env_protection() during compute_input_stats, but DescrptBlockRepformers only had the attributes without accessor methods, causing AttributeError when training DPA2 models.
1 parent 4ebce58 commit e48497c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

deepmd/dpmodel/descriptor/repformers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ def get_rcut(self) -> float:
345345
"""Returns the cut-off radius."""
346346
return self.rcut
347347

348+
def get_rcut_smth(self) -> float:
349+
"""Returns the radius where the neighbor information starts to smoothly decay to 0."""
350+
return self.rcut_smth
351+
352+
def get_env_protection(self) -> float:
353+
"""Returns the protection of building environment matrix."""
354+
return self.env_protection
355+
348356
def get_nsel(self) -> int:
349357
"""Returns the number of selected atoms in the cut-off radius."""
350358
return sum(self.sel)

0 commit comments

Comments
 (0)