Skip to content

Commit 84384dd

Browse files
committed
add test emd2
1 parent 127adba commit 84384dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_ot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ def test_emd_sparse():
132132

133133
Gs = ot.emd([], [], M, dense=False)
134134

135+
ws = ot.emd2([], [], M, dense=False)
136+
135137
# check G is the same
136138
np.testing.assert_allclose(G, Gs.todense())
137-
# check constraints
139+
# check value
140+
np.testing.assert_allclose(Gs.multiply(M).sum(), ws, rtol=1e-6)
138141

139142

140143
def test_emd2_multi():

0 commit comments

Comments
 (0)