Skip to content

Commit

Permalink
Update ener_model.py
Browse files Browse the repository at this point in the history
Signed-off-by: Anchor Yu <[email protected]>
  • Loading branch information
1azyking authored Dec 15, 2024
1 parent 19d0cd3 commit 7dead9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/pt/model/model/ener_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
)

DPEnergyModel_ = make_model(DPEnergyAtomicModel)
DPEnergyModel_ = make_hessian_model(DPEnergyModel_)


@BaseModel.register("ener")
Expand All @@ -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

Expand Down

0 comments on commit 7dead9c

Please sign in to comment.