Skip to content

Commit 62e4773

Browse files
committed
Update deep_eval.py
1 parent c10834d commit 62e4773

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

deepmd/pt/infer/deep_eval.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ def _get_request_defs(self, atomic: bool) -> list[OutputVariableDef]:
397397
The requested output definitions.
398398
"""
399399
if atomic:
400-
return list(self.output_def.var_defs.values())
400+
output_defs = list(self.output_def.var_defs.values())
401401
else:
402-
return [
402+
output_defs = [
403403
x
404404
for x in self.output_def.var_defs.values()
405405
if x.category
@@ -411,6 +411,13 @@ def _get_request_defs(self, atomic: bool) -> list[OutputVariableDef]:
411411
OutputVariableCategory.DERV_R_DERV_R,
412412
)
413413
]
414+
if not self.get_has_hessian():
415+
output_defs = [
416+
x
417+
for x in output_defs
418+
if x.category != OutputVariableCategory.DERV_R_DERV_R
419+
]
420+
return output_defs
414421

415422
def _eval_func(self, inner_func: Callable, numb_test: int, natoms: int) -> Callable:
416423
"""Wrapper method with auto batch size.

0 commit comments

Comments
 (0)