提交 689a4bf4 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 fixes for new file.

上级 1128c1b3
...@@ -2,7 +2,7 @@ import os ...@@ -2,7 +2,7 @@ import os
import numpy import numpy
import theano import theano
from theano import Apply, gof, tensor, config, Variable from theano import Apply, tensor, config, Variable
from theano.scalar import as_scalar, constant from theano.scalar import as_scalar, constant
from theano.gradient import DisconnectedType, grad_not_implemented from theano.gradient import DisconnectedType, grad_not_implemented
from theano.gof import Optimizer, local_optimizer, COp from theano.gof import Optimizer, local_optimizer, COp
...@@ -485,8 +485,8 @@ class GpuDnnConv(DnnBase, COp): ...@@ -485,8 +485,8 @@ class GpuDnnConv(DnnBase, COp):
return ( return (
b, nb, b, nb,
(h + 2*padh - kh)//sh + 1, (h + 2 * padh - kh) // sh + 1,
(w + 2*padw - kw)//sw + 1 (w + 2 * padw - kw) // sw + 1
) )
def infer_shape(self, node, shape): def infer_shape(self, node, shape):
...@@ -858,8 +858,8 @@ class GpuDnnPool(DnnBase): ...@@ -858,8 +858,8 @@ class GpuDnnPool(DnnBase):
return [( return [(
shape[0][0], shape[0][0],
shape[0][1], shape[0][1],
(shape[0][2] + 2*padh - kh)//sh + 1, (shape[0][2] + 2 * padh - kh) // sh + 1,
(shape[0][3] + 2*padw - kw)//sw + 1 (shape[0][3] + 2 * padw - kw) // sw + 1
)] )]
def c_support_code_struct(self, node, name): def c_support_code_struct(self, node, name):
...@@ -976,8 +976,8 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) { ...@@ -976,8 +976,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, set_in=set_in, name=name, set_in=set_in,
set_out=set_out, input=inputs[0], set_out=set_out, 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
...@@ -1184,10 +1184,10 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) { ...@@ -1184,10 +1184,10 @@ if (err%(name)s != CUDNN_STATUS_SUCCESS) {
fail=sub['fail'], fail=sub['fail'],
name=name, set_in=set_in, name=name, set_in=set_in,
set_out=set_out, input=inp, input_grad=inp_grad, output=out, set_out=set_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 (5, version()) return (5, version())
...@@ -1725,8 +1725,8 @@ if True: ...@@ -1725,8 +1725,8 @@ if True:
def local_softmax_dnn_grad(node): def local_softmax_dnn_grad(node):
if (isinstance(node.op, SoftmaxGrad) and if (isinstance(node.op, SoftmaxGrad) and
((node.inputs[0].owner and ((node.inputs[0].owner and
isinstance(node.inputs[0].owner.op, HostFromGpu)) isinstance(node.inputs[0].owner.op, HostFromGpu)) or
or (node.inputs[1].owner and (node.inputs[1].owner and
isinstance(node.inputs[1].owner.op, HostFromGpu)))): isinstance(node.inputs[1].owner.op, HostFromGpu)))):
if not dnn_available(): if not dnn_available():
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论