Skip to content

Commit 17699d7

Browse files
Fix deprecation warning of .T for 1-d inputs (#761)
* Fix deprecation warning of .T for 1-d inputs * Update RELEASES.md
1 parent 3a53dff commit 17699d7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- Fix doc for projection sparse simplex (PR #734, PR #746)
4242
- Changed the default behavior of `ot.lp.solver_1d.wasserstein_circle` (Issue #738)
4343
- Avoid raising unnecessary warnings in `ot.lp.solver_1d.binary_search_circle` (Issue #738)
44+
- Avoid deprecation warning in `ot.lp.solver_1d.wasserstein_1d` (Issue #760, PR #761)
4445

4546
## 0.9.5
4647

ot/lp/solver_1d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def quantile_function(qs, cws, xs):
3838
if nx.__name__ == "torch":
3939
# this is to ensure the best performance for torch searchsorted
4040
# and avoid a warning related to non-contiguous arrays
41-
cws = cws.T.contiguous()
42-
qs = qs.T.contiguous()
41+
cws = cws.movedim(0, -1).contiguous()
42+
qs = qs.movedim(0, -1).contiguous()
4343
else:
4444
cws = cws.T
4545
qs = qs.T

0 commit comments

Comments
 (0)