提交 a4cc7dbd authored 作者: notoraptor's avatar notoraptor

Flake8 issue corrected.

上级 a4eb981d
...@@ -736,7 +736,7 @@ def blas_header_text(): ...@@ -736,7 +736,7 @@ def blas_header_text():
if not config.blas.ldflags: if not config.blas.ldflags:
# Include the Numpy version implementation of [sd]gemm_. # Include the Numpy version implementation of [sd]gemm_.
current_filedir = dirname(__file__) current_filedir = dirname(__file__)
gemm_common_filepath = normpath(current_filedir + "/alt_gemm_common.c") gemm_common_filepath = normpath(current_filedir + "/alt_gemm_common.c")
gemm_template_filepath = normpath(current_filedir + "/alt_gemm_template.c") gemm_template_filepath = normpath(current_filedir + "/alt_gemm_template.c")
common_code = "" common_code = ""
sgemm_code = "" sgemm_code = ""
...@@ -745,8 +745,8 @@ def blas_header_text(): ...@@ -745,8 +745,8 @@ def blas_header_text():
common_code = code.read() common_code = code.read()
with open(gemm_template_filepath) as code: with open(gemm_template_filepath) as code:
template_code = code.read() template_code = code.read()
sgemm_code = template_code % {"float_type":"float", "float_size":4, "npy_float":"NPY_FLOAT32", "name":"sgemm_"} sgemm_code = template_code % {"float_type": "float", "float_size": 4, "npy_float": "NPY_FLOAT32", "name": "sgemm_"}
dgemm_code = template_code % {"float_type":"double", "float_size":8, "npy_float":"NPY_FLOAT64", "name":"dgemm_"} dgemm_code = template_code % {"float_type": "double", "float_size": 8, "npy_float": "NPY_FLOAT64", "name": "dgemm_"}
if not common_code or not sgemm_code: if not common_code or not sgemm_code:
raise IOError("Unable to load NumPy implementation of gemm code from C source files.") raise IOError("Unable to load NumPy implementation of gemm code from C source files.")
else: else:
......
...@@ -98,7 +98,7 @@ def local_abstractconv_gemm(node): ...@@ -98,7 +98,7 @@ def local_abstractconv_gemm(node):
def local_abstractconv3d_gemm(node): def local_abstractconv3d_gemm(node):
# If theano.config.blas.ldflags is empty, Theano will use # If theano.config.blas.ldflags is empty, Theano will use
# a NumPy C implementation of [sd]gemm_. # a NumPy C implementation of [sd]gemm_.
if theano.config.cxx == "": # or not theano.config.blas.ldflags: if theano.config.cxx == "": # or not theano.config.blas.ldflags:
return return
if not isinstance(node.op, AbstractConv3d): if not isinstance(node.op, AbstractConv3d):
return None return None
...@@ -145,7 +145,7 @@ def local_abstractconv_gradweight_gemm(node): ...@@ -145,7 +145,7 @@ def local_abstractconv_gradweight_gemm(node):
@local_optimizer([AbstractConv3d_gradWeights]) @local_optimizer([AbstractConv3d_gradWeights])
def local_abstractconv3d_gradweight_gemm(node): def local_abstractconv3d_gradweight_gemm(node):
if theano.config.cxx == "": # or not theano.config.blas.ldflags: if theano.config.cxx == "": # or not theano.config.blas.ldflags:
return return
if not isinstance(node.op, AbstractConv3d_gradWeights): if not isinstance(node.op, AbstractConv3d_gradWeights):
return None return None
...@@ -193,7 +193,7 @@ def local_abstractconv_gradinputs_gemm(node): ...@@ -193,7 +193,7 @@ def local_abstractconv_gradinputs_gemm(node):
@local_optimizer([AbstractConv3d_gradInputs]) @local_optimizer([AbstractConv3d_gradInputs])
def local_abstractconv3d_gradinputs_gemm(node): def local_abstractconv3d_gradinputs_gemm(node):
if theano.config.cxx == "": # or not theano.config.blas.ldflags: if theano.config.cxx == "": # or not theano.config.blas.ldflags:
return return
if not isinstance(node.op, AbstractConv3d_gradInputs): if not isinstance(node.op, AbstractConv3d_gradInputs):
return None return None
......
...@@ -918,7 +918,7 @@ class TestBilinearUpsampling(unittest.TestCase): ...@@ -918,7 +918,7 @@ class TestBilinearUpsampling(unittest.TestCase):
if theano.config.mode == "FAST_COMPILE": if theano.config.mode == "FAST_COMPILE":
compile_mode = compile_mode.excluding("conv_gemm") compile_mode = compile_mode.excluding("conv_gemm")
compile_mode = compile_mode.excluding('AbstractConvCheck') compile_mode = compile_mode.excluding('AbstractConvCheck')
elif not theano.config.cxx: # not theano.config.blas.ldflags or elif not theano.config.cxx: # not theano.config.blas.ldflags or
compile_mode = compile_mode.excluding('AbstractConvCheck') compile_mode = compile_mode.excluding('AbstractConvCheck')
def numerical_kernel_1D(self, ratio): def numerical_kernel_1D(self, ratio):
......
...@@ -131,7 +131,7 @@ class TestCorr2D(utt.InferShapeTester): ...@@ -131,7 +131,7 @@ class TestCorr2D(utt.InferShapeTester):
icol:icol + dil_fil_shape2d[1]:filter_dilation[1]] * filter2d[::-1, ::-1] icol:icol + dil_fil_shape2d[1]:filter_dilation[1]] * filter2d[::-1, ::-1]
).sum() ).sum()
#utt.assert_allclose(theano_output, ref_output) # utt.assert_allclose(theano_output, ref_output)
utt.assert_allclose(ref_output, theano_output) utt.assert_allclose(ref_output, theano_output)
# TEST GRADIENT # TEST GRADIENT
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论