From 2d2fdac36648bbae49b9ae3b7854f16f27914770 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 10 Oct 2023 16:11:12 +0100 Subject: [PATCH] _proximal_step_numpy accepts BlockDataContainer --- Wrappers/Python/cil/optimisation/functions/MixedL21Norm.py | 5 +---- Wrappers/Python/test/test_functions.py | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Wrappers/Python/cil/optimisation/functions/MixedL21Norm.py b/Wrappers/Python/cil/optimisation/functions/MixedL21Norm.py index d3da0cdee..b9e4f2208 100644 --- a/Wrappers/Python/cil/optimisation/functions/MixedL21Norm.py +++ b/Wrappers/Python/cil/optimisation/functions/MixedL21Norm.py @@ -102,10 +102,7 @@ def _proximal_step_numpy(arr, tau): res.maximum(0.0, out=res) res.multiply(arr, out=res) res.divide(tmp, out=res) - - # TODO avoid using numpy, add operation in the framework - # This will be useful when we add cupy - + for el in res.containers: elarray = el.as_array() diff --git a/Wrappers/Python/test/test_functions.py b/Wrappers/Python/test/test_functions.py index c8ba83dbd..115531e55 100644 --- a/Wrappers/Python/test/test_functions.py +++ b/Wrappers/Python/test/test_functions.py @@ -457,7 +457,10 @@ def test_MixedL21Norm_proximal_step_numpy_bdc(self): sigma1 = 1./tmp_sigma tmp = ig.allocate(1) - # tau = ig.allocate(2) + + # this test only makes sense if the shape of the various containers + # in the bdc is the same. + # Does it make sense to keep this? a = _proximal_step_numpy(tmp, sigma1) sigma2 = -1./tmp_sigma