diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2022-02-10 16:31:32 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2022-02-11 15:44:42 +0100 |
commit | 7b676317b3e49fe0bd2a44741d8d383f5c85d76a (patch) | |
tree | b6bfa1a0a09195828c2ca3b0375c899adab5d715 /gnu/packages/machine-learning.scm | |
parent | 8b787eb929effcd1c3ded2a284bc76890d79c67f (diff) | |
download | guix-7b676317b3e49fe0bd2a44741d8d383f5c85d76a.tar.gz |
gnu: Add python-pytorch-for-r-torch.
* gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/machine-learning.scm (python-pytorch-for-r-torch): New variable.
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c7ed7bb31e..0c01617297 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -3034,6 +3034,53 @@ PyTorch when needed. Note: currently this package does not provide GPU support.") (license license:bsd-3))) +(define-public python-pytorch-for-r-torch + (package + (inherit python-pytorch) + (name "python-pytorch") + (version "1.9.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pytorch/pytorch") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0cznsh68hwk5761gv7iijb4g6jgjpvs3bbixwpzzmkbkbn2q96c1")) + (patches (search-patches "python-pytorch-1.9.0-system-libraries.patch" + "python-pytorch-runpath.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; XXX: Let's be clear: this package is a bundling fest. We + ;; delete as much as we can, but there's still a lot left. + (for-each (lambda (directory) + (delete-file-recursively + (string-append "third_party/" directory))) + '("benchmark" "cpuinfo" "eigen" + + ;; FIXME: QNNPACK (of which XNNPACK is a fork) + ;; needs these. + ;; "FP16" "FXdiv" "gemmlowp" "psimd" + + "gloo" "googletest" "ios-cmake" "NNPACK" + "onnx" "protobuf" "pthreadpool" + "pybind11" "python-enum" "python-peachpy" + "python-six" "tbb" "XNNPACK" "zstd")) + + ;; Adjust references to the onnx-optimizer headers. + (substitute* "caffe2/onnx/backend.cc" + (("onnx/optimizer/") + "onnxoptimizer/")))))) + (arguments + (substitute-keyword-arguments (package-arguments python-pytorch) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + ;; No module named 'onnx.optimizer' + (delete 'sanity-check))))))) + (define-public python-hmmlearn (package (name "python-hmmlearn") |