guix_mirror_bot pushed a commit to branch master
in repository guix.
commit cb5934e85efffc494f5b980703e7de585004174c
Author: Ayan Das <[email protected]>
AuthorDate: Thu Jan 29 16:02:23 2026 +0530
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 <[email protected]>
---
gnu/packages/machine-learning.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index 43b1f7420b..e66660b992 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