From 3030e93dd508d3c60053525a5fad48d3d3c68ace Mon Sep 17 00:00:00 2001 From: Theo Steininger Date: Tue, 18 Jul 2017 15:41:52 +0200 Subject: [PATCH] Added `distribution_strategy=x.distribution_strategy` to default fields in InvertibleOperatorMixin --- .../invertible_operator_mixin.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py b/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py index af952177..483840cc 100644 --- a/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py +++ b/nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py @@ -71,7 +71,8 @@ class InvertibleOperatorMixin(object): def _times(self, x, spaces, x0=None): if x0 is None: - x0 = Field(self.target, val=0., dtype=x.dtype) + x0 = Field(self.target, val=0., dtype=x.dtype, + distribution_strategy=x.distribution_strategy) (result, convergence) = self.__inverter(A=self.inverse_times, b=x, @@ -80,7 +81,8 @@ class InvertibleOperatorMixin(object): def _adjoint_times(self, x, spaces, x0=None): if x0 is None: - x0 = Field(self.domain, val=0., dtype=x.dtype) + x0 = Field(self.domain, val=0., dtype=x.dtype, + distribution_strategy=x.distribution_strategy) (result, convergence) = self.__inverter(A=self.adjoint_inverse_times, b=x, @@ -89,7 +91,8 @@ class InvertibleOperatorMixin(object): def _inverse_times(self, x, spaces, x0=None): if x0 is None: - x0 = Field(self.domain, val=0., dtype=x.dtype) + x0 = Field(self.domain, val=0., dtype=x.dtype, + distribution_strategy=x.distribution_strategy) (result, convergence) = self.__inverter(A=self.times, b=x, @@ -98,7 +101,8 @@ class InvertibleOperatorMixin(object): def _adjoint_inverse_times(self, x, spaces, x0=None): if x0 is None: - x0 = Field(self.target, val=0., dtype=x.dtype) + x0 = Field(self.target, val=0., dtype=x.dtype, + distribution_strategy=x.distribution_strategy) (result, convergence) = self.__inverter(A=self.adjoint_times, b=x, -- GitLab