From 7059f44440c264cb534336dcd4c84dc5687c7b44 Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Mon, 13 Jan 2020 17:18:02 -0500 Subject: [PATCH] python3Packages.tensorly: init at 0.4.5 --- .../python-modules/tensorly/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/tensorly/default.nix diff --git a/pkgs/development/python-modules/tensorly/default.nix b/pkgs/development/python-modules/tensorly/default.nix new file mode 100644 index 00000000000..33aca636f45 --- /dev/null +++ b/pkgs/development/python-modules/tensorly/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest +, nose +, isPy27 +, numpy +, scipy +, sparse +, pytorch +}: + +buildPythonPackage rec { + pname = "tensorly"; + version = "0.4.5"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = version; + sha256 = "1ml91yaxwx4msisxbm92yf22qfrscvk58f3z2r1jhi96pw2k4i7x"; + }; + + propagatedBuildInputs = [ numpy scipy sparse ]; + checkInputs = [ pytest nose pytorch ]; + # also has a cupy backend, but the tests are currently broken + # (e.g. attempts to access cupy.qr instead of cupy.linalg.qr) + # and this backend also adds a non-optional CUDA dependence, + # as well as tensorflow and mxnet backends, but the tests don't + # seem to exercise these backend by default + + checkPhase = '' + runHook preCheck + nosetests -e "test_cupy" + runHook postCheck + ''; + + meta = with lib; { + description = "Tensor learning in Python"; + homepage = https://tensorly.org/; + license = licenses.bsd3; + maintainers = [ maintainers.bcdarwin ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 610a8d0852f..f510f29facc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6581,6 +6581,8 @@ in { cudaSupport = true; }; + tensorly = callPackage ../development/python-modules/tensorly { }; + tflearn = callPackage ../development/python-modules/tflearn { }; simpleai = callPackage ../development/python-modules/simpleai { };