diff options
Diffstat (limited to 'test/test_ot.py')
-rw-r--r-- | test/test_ot.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_ot.py b/test/test_ot.py index c756e51..245a107 100644 --- a/test/test_ot.py +++ b/test/test_ot.py @@ -337,10 +337,11 @@ def test_dual_variables(): # Check that both cost computations are equivalent np.testing.assert_almost_equal(cost1, log['cost']) check_duality_gap(a, b, M, G, log['u'], log['v'], log['cost']) - - viol=log['u'][:,None]+log['v'][None,:]-M - - assert viol.max()<1e-8 + + viol = log['u'][:, None] + log['v'][None, :] - M + + assert viol.max() < 1e-8 + def check_duality_gap(a, b, M, G, u, v, cost): cost_dual = np.vdot(a, u) + np.vdot(b, v) |