diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2019-12-02 13:34:05 +0100 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2019-12-02 13:34:05 +0100 |
commit | 84384dd9e5dc78ed5cc867a53bd1de31c05d77fc (patch) | |
tree | d0b1b15dcef854f89e62fe40ab93c9aac7b338e6 | |
parent | 127adbaf4eef7a6dffbdcd4f930fc6301587f861 (diff) |
add test emd2
-rw-r--r-- | test/test_ot.py | 5 |
1 files changed, 4 insertions, 1 deletions
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(): |