[bug#78687,5/5] gnu: python-captum: Fix tests for PyTorch 2.7.0.

Message ID d5bed45b781a562c8d20c25bc7bcc48a@riseup.net
State New
Headers
Series Update PyTorch to 2.7.0 with dependencies |

Commit Message

Ayan Das June 4, 2025, 2:47 a.m. UTC
  From e4eba433f77c0c91f7c8767a094addfa6c719093 Mon Sep 17 00:00:00 2001
Message-ID:
<e4eba433f77c0c91f7c8767a094addfa6c719093.1748983877.git.bvits@riseup.net>
In-Reply-To: <cover.1748983877.git.bvits@riseup.net>
References: <cover.1748983877.git.bvits@riseup.net>
From: Ayan Das <bvits@riseup.net>
Date: Wed, 4 Jun 2025 01:32:38 +0530
Subject: [PATCH 5/5] gnu: python-captum: Fix tests for PyTorch 2.7.0.

* gnu/packages/machine-learning.scm (python-captum)[arguments]: Skip
test_exp_sets_with_diffent_lengths which fails with PyTorch 2.7.0's
stricter torch.load weights_only behavior.
---
 gnu/packages/machine-learning.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

+                   " and not test_exp_sets_with_diffent_lengths"))))
     (propagated-inputs
      (list python-matplotlib python-numpy python-pytorch python-tqdm))
     (native-inputs (list jupyter
  

Patch

diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index c72f23d76f..06dd6489a9 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5610,11 +5610,14 @@  (define-public python-captum
     (arguments
      (list
       #:test-flags
-      '(list "-k"
-             ;; These two tests (out of more than 1000 tests) fail
because of
-             ;; accuracy problems.
-             "not test_softmax_classification_batch_multi_target\
- and not test_softmax_classification_batch_zero_baseline")))
+      '(list "-k" (string-append
+                   ;; These two tests (out of more than 1000 tests)
fail because of
+                   ;; accuracy problems.
+                   "not test_softmax_classification_batch_multi_target"
+                   " and not
test_softmax_classification_batch_zero_baseline"
+                   ;; This test fails with PyTorch 2.7.0 due to
stricter
+                   ;; torch.load weights_only behavior.