Skip to content

Commit 5de4614

Browse files
authored
Fix device for minibatch OT and test out of space (#784)
* fix device * tets cleanup * add cahing for pyton * cleanup action for doc too
1 parent 9412193 commit 5de4614

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/workflows/build_doc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
# Standard drop-in approach that should work for most people.
18-
18+
- name: Free Disk Space (Ubuntu)
19+
uses: insightsengineering/disk-space-reclaimer@v1
20+
with:
21+
android: true
22+
dotnet: true
1923
- name: Set up Python 3.10
2024
uses: actions/setup-python@v5
2125
with:
2226
python-version: "3.10"
27+
cache: 'pip'
2328

2429
- name: Get Python running
2530
run: |

.github/workflows/build_tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ jobs:
6464
python-version: ["3.10", "3.11", "3.12", "3.13"]
6565

6666
steps:
67+
- name: Free Disk Space (Ubuntu)
68+
uses: insightsengineering/disk-space-reclaimer@v1
69+
with:
70+
android: true
71+
dotnet: true
6772
- uses: actions/checkout@v4
6873
- name: Set up Python ${{ matrix.python-version }}
6974
uses: actions/setup-python@v5
7075
with:
7176
python-version: ${{ matrix.python-version }}
77+
cache: 'pip'
7278
- name: Install POT
7379
run: |
7480
pip install -e .
@@ -93,6 +99,7 @@ jobs:
9399
uses: actions/setup-python@v5
94100
with:
95101
python-version: "3.13"
102+
cache: 'pip'
96103
- name: Install dependencies
97104
run: |
98105
python -m pip install --upgrade pip setuptools
@@ -121,6 +128,7 @@ jobs:
121128
uses: actions/setup-python@v5
122129
with:
123130
python-version: ${{ matrix.python-version }}
131+
cache: 'pip'
124132
- name: Install POT
125133
run: |
126134
pip install -e .
@@ -148,6 +156,7 @@ jobs:
148156
uses: actions/setup-python@v5
149157
with:
150158
python-version: ${{ matrix.python-version }}
159+
cache: 'pip'
151160
- name: RC.exe
152161
run: |
153162
function Invoke-VSDevEnvironment {

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This new release adds support for sparse cost matrices in the exact EMD solver.
1111
- Add support for sparse cost matrices in EMD solver (PR #778, Issue #397)
1212
- Fix deprecated JAX function in `ot.backend.JaxBackend` (PR #771, Issue #770)
1313
- Add test for build from source (PR #772, Issue #764)
14+
- Fix device for batch Ot solver in `ot.batch` (PR #784, Issue #783)
1415

1516
## 0.9.6.post1
1617

ot/batch/_linear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ def solve_batch(
310310
B, n, m = M.shape
311311

312312
if a is None:
313-
a = nx.ones((B, n)) / n
313+
a = nx.ones((B, n), type_as=M) / n
314314
if b is None:
315-
b = nx.ones((B, m)) / m
315+
b = nx.ones((B, m), type_as=M) / m
316316

317317
if solver == "log_sinkhorn":
318318
K = -M / reg

0 commit comments

Comments
 (0)