Skip to content

Commit

Permalink
test if hessian_value is none by testing if hessian_value is none (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins authored Jan 8, 2025
1 parent 8124b97 commit 43760f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyadjoint/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_derivative(self, options={}):
return self.control._ad_convert_type(self.block_variable.adj_value, options=options)

def get_hessian(self, options={}):
if self.block_variable.adj_value is None:
if self.block_variable.hessian_value is None:
logging.warning("Hessian value is None, is the functional independent of the control variable?")
return self.control._ad_convert_type(0., options=options)
return self.control._ad_convert_type(self.block_variable.hessian_value, options=options)
Expand Down

0 comments on commit 43760f5

Please sign in to comment.