From 84384dd9e5dc78ed5cc867a53bd1de31c05d77fc Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Mon, 2 Dec 2019 13:34:05 +0100 Subject: add test emd2 --- test/test_ot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/test_ot.py') diff --git a/test/test_ot.py b/test/test_ot.py index 8602022..507d188 100644 --- a/test/test_ot.py +++ b/test/test_ot.py @@ -132,9 +132,12 @@ def test_emd_sparse(): Gs = ot.emd([], [], M, dense=False) + ws = ot.emd2([], [], M, dense=False) + # check G is the same np.testing.assert_allclose(G, Gs.todense()) - # check constraints + # check value + np.testing.assert_allclose(Gs.multiply(M).sum(), ws, rtol=1e-6) def test_emd2_multi(): -- cgit v1.2.3