summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAyan Das <bvits@riseup.net>2026-01-29 16:02:23 +0530
committerLudovic Courtès <ludo@gnu.org>2026-02-22 18:41:11 +0100
commitcb5934e85efffc494f5b980703e7de585004174c (patch)
treeea8a85070bdb5d101c60084d8cb09530e4b6436d /gnu
parent3cdb9a09c1b14118e55afa9df405d2a9c54d3bd8 (diff)
gnu: python-botorch: Fix tests with PyTorch 2.10.
* gnu/packages/machine-learning.scm (python-botorch): Substitute out an invalid call to `view\' that passes a torch.Size plus extra arguments, which PyTorch 2.10 rejects. Change-Id: I71a47dab611ad33c3f765c74093aeadabc9f4c8d Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/machine-learning.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 43b1f7420bd..e66660b992e 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -6620,7 +6620,22 @@ linear algebra routines needed for structured matrices (or operators).")
" and not test_emsemble_map_saas"
" and not test_negative_fixed_features")
;; Requires optional 'pfns' dependency.
- "--ignore=test_community/")))
+ "--ignore=test_community/")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-hypervolume-initial-hvs
+ (lambda _
+ ;; PyTorch 2.10 rejects passing a torch.Size plus extra args to `view'.
+ (substitute* "botorch/utils/multi_objective/hypervolume.py"
+ (("self\\._batch_sample_shape, *\\*obj\\.shape\\[-2:\\]")
+ "self._batch_sample_shape"))))
+ (add-before 'build 'pretend-version
+ ;; The version string is usually derived via setuptools-scm,
+ ;; but without the git metadata available, the version string
+ ;; is set to '0.0.0'.
+ (lambda _
+ (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
+ #$(package-version this-package)))))))
(propagated-inputs (list python-gpytorch
python-linear-operator
python-multipledispatch