Skip to content

Commit e9864c7

Browse files
Merge pull request #1344 from KrisThielemans/fixHessian
fix STIR.ObjectiveFunction.accumulate_Hessian_times_input
2 parents 82aecc5 + cc970dd commit e9864c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xSTIR/pSTIR/STIR.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,7 @@ def accumulate_Hessian_times_input(self, current_estimate, input_, subset=-1, ou
28802880
"""Computes the multiplication of the Hessian at current_estimate with a vector and adds it to output.
28812881
"""
28822882
if out is None or out.handle is None:
2883-
out = input_.clone()
2883+
out = input_.get_uniform_copy(0.0)
28842884
try_calling(pystir.cSTIR_objectiveFunctionAccumulateHessianTimesInput
28852885
(self.handle, current_estimate.handle, input_.handle, subset, out.handle))
28862886
return out
@@ -2889,7 +2889,7 @@ def multiply_with_Hessian(self, current_estimate, input_, subset=-1, out=None):
28892889
"""Computes the multiplication of the Hessian at current_estimate with a vector.
28902890
"""
28912891
if out is None or out.handle is None:
2892-
out = input_.get_uniform_copy(0.0)
2892+
out = input_.get_uniform_copy(0.0) # actual value doesn't matter as STIR will overwrite it.
28932893
try_calling(pystir.cSTIR_objectiveFunctionComputeHessianTimesInput
28942894
(self.handle, current_estimate.handle, input_.handle, subset, out.handle))
28952895
return out

0 commit comments

Comments
 (0)