There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

Commit c9b584a3 authored by Martin Reinecke's avatar Martin Reinecke

shorter fix

parent 02c18676
Pipeline #91949 passed with stages
in 11 minutes and 12 seconds
......@@ -78,13 +78,10 @@ def test_actual_gradients(f, cplxpos, cplxdir, holomorphic):
eps *= (1+0.78j)
var0 = ift.Linearization.make_var(fld)
var1 = ift.Linearization.make_var(fld + eps)
if isinstance(f, tuple):
f0 = var0.ptw(*f).val.val
f1 = var1.ptw(*f).val.val
df1 = _lin2grad(var0.ptw(*f))
else:
f0 = var0.ptw(f).val.val
f1 = var1.ptw(f).val.val
df1 = _lin2grad(var0.ptw(f))
if not isinstance(f, tuple):
f = (f,)
f0 = var0.ptw(*f).val.val
f1 = var1.ptw(*f).val.val
df1 = _lin2grad(var0.ptw(*f))
df0 = (f1 - f0)/eps
assert_allclose(df0, df1, rtol=100*np.abs(eps))
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