Skip to content

Commit 271e333

Browse files
author
Pierre-Louis Barbarant
committed
Add testing of transport plan equality
1 parent 30220de commit 271e333

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/solvers/test_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_solvers_sinkhorn_sparse(pot_method, solver, is_log):
109109

110110
uot_params = torch.tensor(float("inf")), torch.tensor(float("inf")), eps
111111

112-
_, log = ot.sinkhorn(
112+
gamma, log = ot.sinkhorn(
113113
ws,
114114
wt,
115115
cost,
@@ -134,7 +134,7 @@ def test_solvers_sinkhorn_sparse(pot_method, solver, is_log):
134134

135135
# Check the potentials
136136
else:
137-
(alpha, beta), _ = solver(
137+
(alpha, beta), pi = solver(
138138
cost.to_sparse_csr(),
139139
init_duals,
140140
uot_params,
@@ -147,3 +147,4 @@ def test_solvers_sinkhorn_sparse(pot_method, solver, is_log):
147147
alpha,
148148
)
149149
assert torch.allclose(log["beta"], beta)
150+
assert torch.allclose(gamma, pi.to_dense(), atol=1e-5)

0 commit comments

Comments
 (0)