aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/machine-learning.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r--gnu/packages/machine-learning.scm44
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 177d1aaa4f..b32e5ef289 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -675,6 +675,50 @@ standard data types.")
;; headers, hence the name change.
(deprecated-package "python-onnx" onnx))
+(define-public onnx-optimizer
+ (package
+ (name "onnx-optimizer")
+ ;; Note: 0.2.x is *more* recent than 1.5.0.
+ (version "0.2.6")
+ (home-page "https://github.com/onnx/optimizer")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "1wkqqdxcxpfbf8zpbdfdd3zz5jkw775g31gyykj11z4y6pp659l6"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "onnx-optimizer-system-library.patch"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "third_party"))))
+ (build-system python-build-system)
+ (arguments (package-arguments onnx)) ;reuse build system tweaks
+ (native-inputs
+ `(("cmake" ,cmake)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-nbval" ,python-nbval)
+ ("python-coverage" ,python-coverage)))
+ (inputs
+ `(("onnx" ,onnx)
+ ("protobuf" ,protobuf)
+ ("pybind11" ,pybind11)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)))
+ (synopsis "Library to optimize ONNX models")
+ (description
+ "This package provides a C++ and Python library for performing arbitrary
+optimizations on ONNX models, as well as a growing list of prepackaged
+optimization passes.
+
+Not all possible optimizations can be directly implemented on ONNX graphs---
+some will need additional backend-specific information---but many can, and the
+aim is to provide all such passes along with ONNX so that they can be re-used
+with a single function call.")
+ (license license:expat)))
+
(define-public rxcpp
(package
(name "rxcpp")
use-module (guix packages) #:use-module (guix records) #:use-module (ice-9 match) #:export (joycond-configuration joycond-configuration? joycond-service-type wesnothd-configuration wesnothd-configuration? wesnothd-service-type)) ;;; ;;; Joycond ;;; (define-configuration/no-serialization joycond-configuration (package (package joycond) "The joycond package to use")) (define (joycond-shepherd-service config) (let ((joycond (joycond-configuration-package config))) (list (shepherd-service (documentation "Run joycond.") (provision '(joycond)) (requirement '(bluetooth)) (start #~(make-forkexec-constructor (list #$(file-append joycond "/bin/joycond")))) (stop #~(make-kill-destructor)))))) (define joycond-service-type (service-type (name 'joycond) (description "Run @command{joycond} for pairing Nintendo joycons via Bluetooth.") (extensions (list (service-extension shepherd-root-service-type joycond-shepherd-service))) (default-value (joycond-configuration)))) ;;; ;;; The Battle for Wesnoth server ;;; (define-record-type* <wesnothd-configuration> wesnothd-configuration make-wesnothd-configuration wesnothd-configuration? (package wesnothd-configuration-package (default wesnoth-server)) (port wesnothd-configuration-port (default 15000))) (define %wesnothd-accounts (list (user-account (name "wesnothd") (group "wesnothd") (system? #t) (comment "Wesnoth daemon user") (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))) (user-group (name "wesnothd") (system? #t)))) (define wesnothd-shepherd-service (match-lambda (($ <wesnothd-configuration> package port) (let ((wesnothd (least-authority-wrapper (file-append package "/bin/wesnothd") #:name "wesnothd" #:mappings (list (file-system-mapping (source "/var/run/wesnothd") (target source) (writable? #t))) #:namespaces (delq 'net %namespaces)))) (shepherd-service (documentation "The Battle for Wesnoth server") (provision '(wesnoth-daemon)) (requirement '(networking)) (start #~(make-forkexec-constructor (list #$wesnothd "-p" #$(number->string port)) #:user "wesnothd" #:group "wesnothd")) (stop #~(make-kill-destructor))))))) (define wesnothd-activation (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) (let* ((user (getpw "wesnothd")) (directory "/var/run/wesnothd")) ;; wesnothd creates a Unix-domain socket in DIRECTORY. (mkdir-p directory) (chown directory (passwd:uid user) (passwd:gid user)))))) (define wesnothd-service-type (service-type (name 'wesnothd) (description "Run The Battle for Wesnoth server @command{wesnothd}.") (extensions (list (service-extension account-service-type (const %wesnothd-accounts)) (service-extension activation-service-type (const wesnothd-activation)) (service-extension shepherd-root-service-type (compose list wesnothd-shepherd-service)))) (default-value (wesnothd-configuration))))