From 4411b29065635a2058d713b70b43076eedaab24f Mon Sep 17 00:00:00 2001 From: Tom Hunger Date: Wed, 26 Dec 2018 18:26:26 +0000 Subject: [PATCH] opt-einsum: init at 2.3.2 --- .../python-modules/opt-einsum/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/python-modules/opt-einsum/default.nix diff --git a/pkgs/development/python-modules/opt-einsum/default.nix b/pkgs/development/python-modules/opt-einsum/default.nix new file mode 100644 index 000000000000..c28105d4e492 --- /dev/null +++ b/pkgs/development/python-modules/opt-einsum/default.nix @@ -0,0 +1,31 @@ +{ buildPythonPackage, fetchPypi, lib, numpy, pytest, pytestpep8, pytestcov }: +buildPythonPackage rec { + version = "2.3.2"; + pname = "opt_einsum"; + + src = fetchPypi { + inherit version pname; + sha256 = "0ny3v8x83mzpwmqjdzqhzy2pzwyy4wx01r1h9i29xw3yvas69m6k"; + }; + + checkInputs = [ + pytest + pytestpep8 + pytestcov + ]; + + checkPhase = '' + pytest + ''; + + propagatedBuildInputs = [ + numpy + ]; + + meta = { + description = "Optimizing NumPy's einsum function with order optimization and GPU support."; + homepage = http://optimized-einsum.readthedocs.io; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ teh ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a377046c990b..ca094e657d5b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2416,6 +2416,8 @@ in { cudaSupport = pkgs.config.cudaSupport or false; }; + opt-einsum = callPackage ../development/python-modules/opt-einsum {}; + pytorchWithCuda = self.pytorch.override { cudaSupport = true; };