提交 5b5bd0a5 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 for sandbox/cuda/opt_util.py (which shouldn't have been on the whitelist to start with).

上级 7d17da6d
...@@ -2,7 +2,6 @@ from functools import wraps ...@@ -2,7 +2,6 @@ from functools import wraps
import numpy import numpy
import theano
from theano import scalar as scal, Constant from theano import scalar as scal, Constant
from theano.gof import local_optimizer from theano.gof import local_optimizer
from theano.tensor import (DimShuffle, get_scalar_constant_value, from theano.tensor import (DimShuffle, get_scalar_constant_value,
...@@ -18,7 +17,7 @@ def grab_cpu_scalar(v, nd): ...@@ -18,7 +17,7 @@ def grab_cpu_scalar(v, nd):
if v.owner is not None: if v.owner is not None:
n = v.owner n = v.owner
if (isinstance(n.op, GpuDimShuffle) and if (isinstance(n.op, GpuDimShuffle) and
n.op.new_order == ('x',) * nd): n.op.new_order == ('x',) * nd):
return host_from_gpu(n.inputs[0]) return host_from_gpu(n.inputs[0])
elif (isinstance(n.op, DimShuffle) and elif (isinstance(n.op, DimShuffle) and
n.op.new_order == ('x',) * nd): n.op.new_order == ('x',) * nd):
...@@ -29,7 +28,7 @@ def grab_cpu_scalar(v, nd): ...@@ -29,7 +28,7 @@ def grab_cpu_scalar(v, nd):
return None return None
else: else:
if (isinstance(v, Constant) and if (isinstance(v, Constant) and
v.broadcastable == (True,) * nd): v.broadcastable == (True,) * nd):
return v.dimshuffle(()) return v.dimshuffle(())
...@@ -63,8 +62,8 @@ def alpha_merge(cls, alpha_in, beta_in, nd): ...@@ -63,8 +62,8 @@ def alpha_merge(cls, alpha_in, beta_in, nd):
@wraps(maker) @wraps(maker)
def opt(node): def opt(node):
if (isinstance(node.op, GpuElemwise) and if (isinstance(node.op, GpuElemwise) and
node.op.scalar_op == scal.mul and node.op.scalar_op == scal.mul and
node.nin == 2): node.nin == 2):
targ = find_node(node.inputs[0], cls) targ = find_node(node.inputs[0], cls)
if targ is None: if targ is None:
targ = find_node(node.inputs[1], cls) targ = find_node(node.inputs[1], cls)
...@@ -87,8 +86,8 @@ def output_merge(cls, alpha_in, beta_in, out_in, nd): ...@@ -87,8 +86,8 @@ def output_merge(cls, alpha_in, beta_in, out_in, nd):
@wraps(maker) @wraps(maker)
def opt(node): def opt(node):
if (isinstance(node.op, GpuElemwise) and if (isinstance(node.op, GpuElemwise) and
node.op.scalar_op == scal.add and node.op.scalar_op == scal.add and
node.nin == 2): node.nin == 2):
targ = find_node(node.inputs[0], cls) targ = find_node(node.inputs[0], cls)
W = node.inputs[1] W = node.inputs[1]
if targ is None: if targ is None:
......
...@@ -290,7 +290,6 @@ whitelist_flake8 = [ ...@@ -290,7 +290,6 @@ whitelist_flake8 = [
"gof/tests/test_cc.py", "gof/tests/test_cc.py",
"gof/tests/test_compute_test_value.py", "gof/tests/test_compute_test_value.py",
"gof/sandbox/equilibrium.py", "gof/sandbox/equilibrium.py",
"sandbox/cuda/opt_util.py",
"gof/tests/test_utils.py", "gof/tests/test_utils.py",
"tensor/tests/_test_mpi_roundtrip.py", "tensor/tests/_test_mpi_roundtrip.py",
] ]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论