Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengqian-Zhang committed Dec 13, 2024
1 parent 9637b6a commit 5ce6d31
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deepmd/dpmodel/fitting/property_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion deepmd/dpmodel/output_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from enum import (
IntEnum,
)
from typing import Union


def check_shape(
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down
Binary file not shown.
Binary file added source/tests/pt/dp-compressed.pth
Binary file not shown.
Binary file not shown.
Binary file added source/tests/pt/dp-original.pth
Binary file not shown.

0 comments on commit 5ce6d31

Please sign in to comment.