1{ buildPythonPackage
2, fetchFromGitHub
3, blas
4, numpy
5, six
6, scipy
7, nose
8, nose-parameterized
9, pydot_ng
10, sphinx
11, pygments
12, libgpuarray
13, python
14, pycuda
15, cudatoolkit
16, cudnn
17, stdenv
18}:
19
20buildPythonPackage rec {
21 name = "Theano-cuda-${version}";
22 version = "0.8.2";
23
24 src = fetchFromGitHub {
25 owner = "Theano";
26 repo = "Theano";
27 rev = "46fbfeb628220b5e42bf8277a5955c52d153e874";
28 sha256 = "1sl91gli3jaw5gpjqqab4fiq4x6282spqciaid1s65pjsf3k55sc";
29 };
30
31 doCheck = false;
32
33 patchPhase = ''
34 pushd theano/sandbox/gpuarray
35 sed -i -re '2s/^/from builtins import bytes\n/g' subtensor.py
36 sed -i -re "s/(b'2')/int(bytes(\1))/g" subtensor.py
37 sed -i -re "s/(ctx.bin_id\[\-2\])/int(\1)/g" subtensor.py
38
39 sed -i -re '2s/^/from builtins import bytes\n/g' dnn.py
40 sed -i -re "s/(b'30')/int(bytes(\1))/g" dnn.py
41 sed -i -re "s/(ctx.bin_id\[\-2:\])/int(\1)/g" dnn.py
42 popd
43 '';
44
45 dontStrip = true;
46
47 propagatedBuildInputs = [
48 blas
49 numpy
50 six
51 scipy
52 nose
53 nose-parameterized
54 pydot_ng
55 sphinx
56 pygments
57 pycuda
58 cudatoolkit
59 libgpuarray
60 ] ++ (stdenv.lib.optional (cudnn != null) [ cudnn ]);
61
62}