From d89b81276f492d747bdbda71856e11c0453fce23 Mon Sep 17 00:00:00 2001 From: epapoutsellis Date: Mon, 29 Apr 2019 16:19:09 +0100 Subject: fix gradient out --- Wrappers/Python/ccpi/optimisation/functions/ScaledFunction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Wrappers') diff --git a/Wrappers/Python/ccpi/optimisation/functions/ScaledFunction.py b/Wrappers/Python/ccpi/optimisation/functions/ScaledFunction.py index 7caeab2..1db223b 100755 --- a/Wrappers/Python/ccpi/optimisation/functions/ScaledFunction.py +++ b/Wrappers/Python/ccpi/optimisation/functions/ScaledFunction.py @@ -59,7 +59,8 @@ class ScaledFunction(object): if out is None: return self.scalar * self.function.gradient(x) else: - out.fill( self.scalar * self.function.gradient(x) ) + self.function.gradient(x, out=out) + out *= self.scalar def proximal(self, x, tau, out=None): '''This returns the proximal operator for the function at x, tau -- cgit v1.2.3