Commit 19335917 authored by Philipp Arras's avatar Philipp Arras

Merge branch 'opsumdomains' into 'NIFTy_5'

Fix handling of metric in _OpSum

See merge request !307
parents aa776e32 3d353eca
Pipeline #46321 passed with stages
in 18 minutes and 58 seconds
......@@ -384,7 +384,6 @@ class _OpSum(Operator):
v = x._val if lin else x
v1 = v.extract(self._op1.domain)
v2 = v.extract(self._op2.domain)
res = None
if not lin:
return self._op1(v1).unite(self._op2(v2))
wm = x.want_metric
......@@ -393,7 +392,7 @@ class _OpSum(Operator):
op = lin1._jac._myadd(lin2._jac, False)
res =, op(x.jac))
if lin1._metric is not None and lin2._metric is not None:
res = res.add_metric(lin1._metric + lin2._metric)
res = res.add_metric(self._op1(x)._metric + self._op2(x)._metric)
return res
def _simplify_for_constant_input_nontrivial(self, c_inp):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment