From 7dead9c6cef822e274ac57bca60d6aef22e9f833 Mon Sep 17 00:00:00 2001 From: Anchor Yu <91590308+1azyking@users.noreply.github.com> Date: Sun, 15 Dec 2024 16:42:19 +0800 Subject: [PATCH] Update ener_model.py Signed-off-by: Anchor Yu <91590308+1azyking@users.noreply.github.com> --- deepmd/pt/model/model/ener_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deepmd/pt/model/model/ener_model.py b/deepmd/pt/model/model/ener_model.py index 560ba12e84..8064d3eac7 100644 --- a/deepmd/pt/model/model/ener_model.py +++ b/deepmd/pt/model/model/ener_model.py @@ -23,7 +23,6 @@ ) DPEnergyModel_ = make_model(DPEnergyAtomicModel) -DPEnergyModel_ = make_hessian_model(DPEnergyModel_) @BaseModel.register("ener") @@ -40,6 +39,8 @@ def __init__( self._hessian_enabled = False def enable_hessian(self): + self.__class__ = make_hessian_model(type(self)) + self.hess_fitting_def = super(type(self), self).atomic_output_def() self.requires_hessian("energy") self._hessian_enabled = True