提交 6f86147d authored 作者: Frederic's avatar Frederic

flake8

上级 ea96b166
...@@ -34,6 +34,7 @@ from theano.tensor.nnet.abstract_conv import (AbstractConv2d, ...@@ -34,6 +34,7 @@ from theano.tensor.nnet.abstract_conv import (AbstractConv2d,
AbstractConv2d_gradWeights, AbstractConv2d_gradWeights,
AbstractConv2d_gradInputs) AbstractConv2d_gradInputs)
def dnn_available(): def dnn_available():
if dnn_available.avail is None: if dnn_available.avail is None:
if not theano.sandbox.cuda.cuda_available: if not theano.sandbox.cuda.cuda_available:
...@@ -67,7 +68,8 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) { ...@@ -67,7 +68,8 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
if config.dnn.library_path: if config.dnn.library_path:
params.append("-L" + config.dnn.library_path) params.append("-L" + config.dnn.library_path)
if config.nvcc.compiler_bindir: if config.nvcc.compiler_bindir:
params.extend(['--compiler-bindir', config.nvcc.compiler_bindir]) params.extend(['--compiler-bindir',
config.nvcc.compiler_bindir])
# Do not run here the test program. It would run on the # Do not run here the test program. It would run on the
# default gpu, not the one selected by the user. If mixed # default gpu, not the one selected by the user. If mixed
# GPU are installed or if the GPUs are configured in # GPU are installed or if the GPUs are configured in
...@@ -1263,6 +1265,7 @@ def dnn_gradweight(img, topgrad, ...@@ -1263,6 +1265,7 @@ def dnn_gradweight(img, topgrad,
out = gpu_alloc_empty(*kerns_shp) out = gpu_alloc_empty(*kerns_shp)
return GpuDnnConvGradW()(img, topgrad, out, desc) return GpuDnnConvGradW()(img, topgrad, out, desc)
def dnn_gradinput(kerns, topgrad, def dnn_gradinput(kerns, topgrad,
img_shp, img_shp,
border_mode='valid', subsample=(1, 1), border_mode='valid', subsample=(1, 1),
...@@ -1550,8 +1553,8 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) { ...@@ -1550,8 +1553,8 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) {
} }
""" % dict(out=out, desc=desc, fail=sub['fail'], """ % dict(out=out, desc=desc, fail=sub['fail'],
name=name, input=inputs[0], name=name, input=inputs[0],
input_desc="input"+name, input_desc="input" + name,
output_desc="output"+name) output_desc="output" + name)
def grad(self, inp, grads): def grad(self, inp, grads):
img, desc = inp img, desc = inp
...@@ -1745,10 +1748,10 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) { ...@@ -1745,10 +1748,10 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) {
""" % dict(output_grad=out_grad, desc=desc, """ % dict(output_grad=out_grad, desc=desc,
fail=sub['fail'], name=name, fail=sub['fail'], name=name,
input=inp, input_grad=inp_grad, output=out, input=inp, input_grad=inp_grad, output=out,
input_desc="input"+name, input_desc="input" + name,
input_grad_desc="input_grad"+name, input_grad_desc="input_grad" + name,
output_desc="output"+name, output_desc="output" + name,
output_grad_desc="output_grad"+name) output_grad_desc="output_grad" + name)
def c_code_cache_version(self): def c_code_cache_version(self):
return (7, version()) return (7, version())
......
...@@ -106,7 +106,6 @@ whitelist_flake8 = [ ...@@ -106,7 +106,6 @@ whitelist_flake8 = [
"sandbox/tests/test_neighbourhoods.py", "sandbox/tests/test_neighbourhoods.py",
"sandbox/tests/test_multinomial.py", "sandbox/tests/test_multinomial.py",
"sandbox/tests/__init__.py", "sandbox/tests/__init__.py",
"sandbox/cuda/dnn.py",
"sandbox/cuda/var.py", "sandbox/cuda/var.py",
"sandbox/cuda/GpuConvGrad3D.py", "sandbox/cuda/GpuConvGrad3D.py",
"sandbox/cuda/basic_ops.py", "sandbox/cuda/basic_ops.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论