diff --git a/deepmd/dpmodel/fitting/property_fitting.py b/deepmd/dpmodel/fitting/property_fitting.py index 8b903af00e..2df4b75494 100644 --- a/deepmd/dpmodel/fitting/property_fitting.py +++ b/deepmd/dpmodel/fitting/property_fitting.py @@ -75,6 +75,7 @@ def __init__( trainable: Union[bool, list[bool]] = True, intensive: bool = False, bias_method: str = "normal", + property_name: Union[str, list] = "property", resnet_dt: bool = True, numb_fparam: int = 0, numb_aparam: int = 0, @@ -90,6 +91,7 @@ def __init__( self.task_dim = task_dim self.intensive = intensive self.bias_method = bias_method + self.property_name = property_name super().__init__( var_name="property", ntypes=ntypes, diff --git a/deepmd/dpmodel/output_def.py b/deepmd/dpmodel/output_def.py index 1359d532ec..7c91f8d650 100644 --- a/deepmd/dpmodel/output_def.py +++ b/deepmd/dpmodel/output_def.py @@ -3,6 +3,7 @@ from enum import ( IntEnum, ) +from typing import Union def check_shape( @@ -197,7 +198,7 @@ def __init__( r_hessian: bool = False, magnetic: bool = False, intensive: bool = False, - sub_var_name: list[str] = [], + sub_var_name: Union[list[str], str, None] = None, ) -> None: self.name = name self.shape = list(shape) @@ -221,6 +222,8 @@ def __init__( self.r_hessian = r_hessian self.magnetic = magnetic self.intensive = intensive + if isinstance(sub_var_name, str): + sub_var_name = [sub_var_name] self.sub_var_name = sub_var_name if self.r_hessian: if not self.reducible: diff --git a/source/tests/pt/dp-compressed-skip-neighbor-stat.pth b/source/tests/pt/dp-compressed-skip-neighbor-stat.pth new file mode 100644 index 0000000000..8d6cefee81 Binary files /dev/null and b/source/tests/pt/dp-compressed-skip-neighbor-stat.pth differ diff --git a/source/tests/pt/dp-compressed.pth b/source/tests/pt/dp-compressed.pth new file mode 100644 index 0000000000..bf8c85fadc Binary files /dev/null and b/source/tests/pt/dp-compressed.pth differ diff --git a/source/tests/pt/dp-original-skip-neighbor-stat.pth b/source/tests/pt/dp-original-skip-neighbor-stat.pth new file mode 100644 index 0000000000..35eca7e6ad Binary files /dev/null and b/source/tests/pt/dp-original-skip-neighbor-stat.pth differ diff --git a/source/tests/pt/dp-original.pth b/source/tests/pt/dp-original.pth new file mode 100644 index 0000000000..4f55a42351 Binary files /dev/null and b/source/tests/pt/dp-original.pth differ