<commit_before>{ buildPythonPackage
, fetchFromGitHub
, numpy
, six
, scipy
, nose
, nose-parameterized
, pydot_ng
, sphinx
, pygments
, libgpuarray
, python
, pycuda
, cudatoolkit
, cudnn
, stdenv
}:

buildPythonPackage rec {
  name = "Theano-cuda-${version}";
  version = "0.8.2";

  src = fetchFromGitHub {
    owner = "Theano";
    repo = "Theano";
    rev = "46fbfeb628220b5e42bf8277a5955c52d153e874";
    sha256 = "1sl91gli3jaw5gpjqqab4fiq4x6282spqciaid1s65pjsf3k55sc";
  };

  doCheck = false;

  patchPhase = ''
    pushd theano/sandbox/gpuarray
    sed -i -re '2s/^/from builtins import bytes\n/g' subtensor.py
    sed -i -re "s/(b'2')/int(bytes(\1))/g" subtensor.py
    sed -i -re "s/(ctx.bin_id\[\-2\])/int(\1)/g" subtensor.py

    sed -i -re '2s/^/from builtins import bytes\n/g' dnn.py
    sed -i -re "s/(b'30')/int(bytes(\1))/g" dnn.py
    sed -i -re "s/(ctx.bin_id\[\-2:\])/int(\1)/g" dnn.py
    popd
  '';

  dontStrip = true;

  propagatedBuildInputs = [
    numpy.blas
    numpy
    six
    scipy
    nose
    nose-parameterized
    pydot_ng
    sphinx
    pygments
    pycuda
    cudatoolkit
    libgpuarray
  ] ++ (stdenv.lib.optional (cudnn != null) [ cudnn ]);

  passthru.cudaSupport = true;
}<commit_msg>TheanoWithCuda: cudnn shouldn't be optional or list wrapped #26263<commit_after>{ buildPythonPackage
, fetchFromGitHub
, numpy
, six
, scipy
, nose
, nose-parameterized
, pydot_ng
, sphinx
, pygments
, libgpuarray
, python
, pycuda
, cudatoolkit
, cudnn
, stdenv
}:

buildPythonPackage rec {
  name = "Theano-cuda-${version}";
  version = "0.8.2";

  src = fetchFromGitHub {
    owner = "Theano";
    repo = "Theano";
    rev = "46fbfeb628220b5e42bf8277a5955c52d153e874";
    sha256 = "1sl91gli3jaw5gpjqqab4fiq4x6282spqciaid1s65pjsf3k55sc";
  };

  doCheck = false;

  patchPhase = ''
    pushd theano/sandbox/gpuarray
    sed -i -re '2s/^/from builtins import bytes\n/g' subtensor.py
    sed -i -re "s/(b'2')/int(bytes(\1))/g" subtensor.py
    sed -i -re "s/(ctx.bin_id\[\-2\])/int(\1)/g" subtensor.py

    sed -i -re '2s/^/from builtins import bytes\n/g' dnn.py
    sed -i -re "s/(b'30')/int(bytes(\1))/g" dnn.py
    sed -i -re "s/(ctx.bin_id\[\-2:\])/int(\1)/g" dnn.py
    popd
  '';

  dontStrip = true;

  propagatedBuildInputs = [
    numpy.blas
    numpy
    six
    scipy
    nose
    nose-parameterized
    pydot_ng
    sphinx
    pygments
    pycuda
    cudatoolkit
    libgpuarray
    cudnn
  ];

  passthru.cudaSupport = true;
}
{'fraction_non_alphanumeric': 0.14789303079416533, 'fraction_numerical': 0.05145867098865478, 'mean_word_length': 2.7752293577981653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5527839', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1060, 'n_words': 197}