Skip to content

Commit

Permalink
fix solvers
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricvincentcuaz committed Jan 6, 2025
1 parent 8e79b24 commit 4342fb0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ot/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,17 @@ def solve_gromov(
# potentials = (log['u'], log['v']) TODO

else: # partial FGW
if unbalanced > nx.sum(a) or unbalanced > nx.sum(b):
raise (ValueError("Partial FGW mass given in reg is too large"))
if unbalanced is None:
raise (
ValueError(
"Partial GW mass given in `unbalanced` must be float and not None"
)
)

elif unbalanced > nx.sum(a) or unbalanced > nx.sum(b):
raise (
ValueError("Partial GW mass given in `unbalanced` is too large")
)
# default values for solver
if max_iter is None:
max_iter = 1000
Expand Down

0 comments on commit 4342fb0

Please sign in to comment.