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

Flake8 for gpuarray/opt.py

上级 8d0b398d
...@@ -10,9 +10,7 @@ except ImportError: ...@@ -10,9 +10,7 @@ except ImportError:
from theano import tensor, scalar, gof from theano import tensor, scalar, gof
from theano.compile import optdb from theano.compile import optdb
from theano.gof import (local_optimizer, EquilibriumDB, from theano.gof import (local_optimizer, EquilibriumDB,
SequenceDB, ProxyDB, SequenceDB, Optimizer, toolbox)
Optimizer, toolbox,
InconsistencyError, EquilibriumOptimizer)
from theano.scan_module import scan_utils, scan_op, scan_opt from theano.scan_module import scan_utils, scan_op, scan_opt
...@@ -28,10 +26,8 @@ from .conv import GpuConv ...@@ -28,10 +26,8 @@ from .conv import GpuConv
from .nnet import (GpuCrossentropySoftmaxArgmax1HotWithBias, from .nnet import (GpuCrossentropySoftmaxArgmax1HotWithBias,
GpuCrossentropySoftmax1HotWithBiasDx, GpuCrossentropySoftmax1HotWithBiasDx,
GpuSoftmaxWithBias, GpuSoftmax) GpuSoftmaxWithBias, GpuSoftmax)
from .elemwise import (GpuElemwise, _is_scalar, from .elemwise import (GpuElemwise, GpuDimShuffle, GpuCAReduceCuda,
GpuDimShuffle, GpuCAReduceCuda,
GpuCAReduceCPY) GpuCAReduceCPY)
from . import fp16_help
from .subtensor import (GpuIncSubtensor, GpuSubtensor, from .subtensor import (GpuIncSubtensor, GpuSubtensor,
GpuAdvancedIncSubtensor1, GpuAdvancedIncSubtensor1,
GpuAdvancedIncSubtensor1_dev20) GpuAdvancedIncSubtensor1_dev20)
...@@ -135,7 +131,7 @@ class InputToGpuOptimizer(Optimizer): ...@@ -135,7 +131,7 @@ class InputToGpuOptimizer(Optimizer):
new_input = host_from_gpu(gpu_from_host(input)) new_input = host_from_gpu(gpu_from_host(input))
fgraph.replace_validate(input, new_input, fgraph.replace_validate(input, new_input,
"InputToGpuOptimizer") "InputToGpuOptimizer")
except TypeError as e: except TypeError:
# This could fail if the inputs are not TensorTypes # This could fail if the inputs are not TensorTypes
pass pass
...@@ -393,7 +389,6 @@ def local_gpua_advanced_incsubtensor(node): ...@@ -393,7 +389,6 @@ def local_gpua_advanced_incsubtensor(node):
return None return None
x, y = node.inputs[0:2] x, y = node.inputs[0:2]
coords = node.inputs[2:]
set_instead_of_inc = node.op.set_instead_of_inc set_instead_of_inc = node.op.set_instead_of_inc
active_device_no = theano.sandbox.cuda.active_device_number() active_device_no = theano.sandbox.cuda.active_device_number()
device_properties = theano.sandbox.cuda.device_properties device_properties = theano.sandbox.cuda.device_properties
...@@ -642,8 +637,7 @@ def local_gpu_elemwise_careduce(node): ...@@ -642,8 +637,7 @@ def local_gpu_elemwise_careduce(node):
# automatically add more case, as some like trigonometic # automatically add more case, as some like trigonometic
# operation with some reduction pattern will probably result # operation with some reduction pattern will probably result
# to slow down. # to slow down.
isinstance(node.inputs[0].owner.op.scalar_op, scalar.basic.Sqr) isinstance(node.inputs[0].owner.op.scalar_op, scalar.basic.Sqr)):
):
op = node.op op = node.op
inp = node.inputs[0].owner.inputs[0] inp = node.inputs[0].owner.inputs[0]
return [GpuCAReduceCuda(scalar_op=op.scalar_op, return [GpuCAReduceCuda(scalar_op=op.scalar_op,
......
...@@ -227,7 +227,6 @@ whitelist_flake8 = [ ...@@ -227,7 +227,6 @@ whitelist_flake8 = [
"sandbox/gpuarray/elemwise.py", "sandbox/gpuarray/elemwise.py",
"sandbox/gpuarray/type.py", "sandbox/gpuarray/type.py",
"sandbox/gpuarray/__init__.py", "sandbox/gpuarray/__init__.py",
"sandbox/gpuarray/opt.py",
"sandbox/gpuarray/blas.py", "sandbox/gpuarray/blas.py",
"sandbox/gpuarray/kernel_codegen.py", "sandbox/gpuarray/kernel_codegen.py",
"sandbox/gpuarray/conv.py", "sandbox/gpuarray/conv.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论