Skip to content

Commit

Permalink
[MRG] Remove redundant abs() (#448)
Browse files Browse the repository at this point in the history
* Remove redundant abs()

* Update RELEASES.md
  • Loading branch information
chaosink authored Mar 21, 2023
1 parent 5835016 commit c48cd76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
- Backend version of `ot.partial` and `ot.smooth` (PR #388)
- Added argument for warmstart of dual potentials in Sinkhorn-based methods in `ot.bregman` (PR #437)
- Add parameters method in `ot.da.SinkhornTransport` (PR #440)
- `ot.dr` now uses the new Pymanopt API and POT is compatible with current
Pymanopt (PR #443)
- `ot.dr` now uses the new Pymanopt API and POT is compatible with current Pymanopt (PR #443)
- Remove the redundant `nx.abs()` at the end of `wasserstein_1d()` (PR #448)

#### Closed issues

Expand Down
2 changes: 1 addition & 1 deletion ot/lp/solver_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def wasserstein_1d(u_values, v_values, u_weights=None, v_weights=None, p=1, requ
diff_quantiles = nx.abs(u_quantiles - v_quantiles)

if p == 1:
return nx.sum(delta * nx.abs(diff_quantiles), axis=0)
return nx.sum(delta * diff_quantiles, axis=0)
return nx.sum(delta * nx.power(diff_quantiles, p), axis=0)


Expand Down

0 comments on commit c48cd76

Please sign in to comment.