From 55f861c551534178f7dd6097f9ed228ba5e8c981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Mon, 8 Dec 2025 13:07:36 +0100 Subject: [PATCH 1/4] fix device --- RELEASES.md | 1 + ot/batch/_linear.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 4d73da648..ad75950eb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -11,6 +11,7 @@ This new release adds support for sparse cost matrices in the exact EMD solver. - Add support for sparse cost matrices in EMD solver (PR #778, Issue #397) - Fix deprecated JAX function in `ot.backend.JaxBackend` (PR #771, Issue #770) - Add test for build from source (PR #772, Issue #764) +- Fix device for batch Ot solver in `ot.batch` (PR #784, Issue #783) ## 0.9.6.post1 diff --git a/ot/batch/_linear.py b/ot/batch/_linear.py index d6ac6cea4..a63fcb404 100644 --- a/ot/batch/_linear.py +++ b/ot/batch/_linear.py @@ -310,9 +310,9 @@ def solve_batch( B, n, m = M.shape if a is None: - a = nx.ones((B, n)) / n + a = nx.ones((B, n), type_as=M) / n if b is None: - b = nx.ones((B, m)) / m + b = nx.ones((B, m), type_as=M) / m if solver == "log_sinkhorn": K = -M / reg From 272d42c80ff535cbeda1d6b29f265cae381e0e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Mon, 8 Dec 2025 13:23:31 +0100 Subject: [PATCH 2/4] tets cleanup --- .github/workflows/build_tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 35a26fc6b..ceffcf5b5 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -64,6 +64,11 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13"] steps: + - name: Free Disk Space (Ubuntu) + uses: insightsengineering/disk-space-reclaimer@v1 + with: + android: true + dotnet: true - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 From 902d6472e53dd46fe4f699bc2a7c5191f323c5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Mon, 8 Dec 2025 13:31:18 +0100 Subject: [PATCH 3/4] add cahing for pyton --- .github/workflows/build_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index ceffcf5b5..28f5edbb3 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -74,6 +74,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install POT run: | pip install -e . @@ -98,6 +99,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.13" + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip setuptools @@ -126,6 +128,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install POT run: | pip install -e . @@ -153,6 +156,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: RC.exe run: | function Invoke-VSDevEnvironment { From 1ca72926b12890a745f716f04de035dc9159f945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Mon, 8 Dec 2025 13:33:02 +0100 Subject: [PATCH 4/4] cleanup action for doc too --- .github/workflows/build_doc.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index d30e1cf31..6575510c5 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -15,11 +15,16 @@ jobs: steps: - uses: actions/checkout@v4 # Standard drop-in approach that should work for most people. - + - name: Free Disk Space (Ubuntu) + uses: insightsengineering/disk-space-reclaimer@v1 + with: + android: true + dotnet: true - name: Set up Python 3.10 uses: actions/setup-python@v5 with: python-version: "3.10" + cache: 'pip' - name: Get Python running run: |