提交 c2a746f2 authored 作者: Iban Harlouchet's avatar Iban Harlouchet 提交者: Iban Harlouchet

flake8 for theano/misc/safe_asarray.py

上级 94059e32
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
Helper function to safely convert an array to a new data type. Helper function to safely convert an array to a new data type.
""" """
__docformat__ = "restructuredtext en"
import numpy import numpy
import theano import theano
__docformat__ = "restructuredtext en"
def _asarray(a, dtype, order=None): def _asarray(a, dtype, order=None):
"""Convert the input to a Numpy array. """Convert the input to a Numpy array.
...@@ -45,11 +45,13 @@ def _asarray(a, dtype, order=None): ...@@ -45,11 +45,13 @@ def _asarray(a, dtype, order=None):
return rval.view(dtype=dtype) return rval.view(dtype=dtype)
else: else:
# Unexpected mismatch: better know what is going on! # Unexpected mismatch: better know what is going on!
raise TypeError('numpy.array did not return the data type we ' raise TypeError(
'numpy.array did not return the data type we '
'asked for (%s %s #%s), instead it returned type ' 'asked for (%s %s #%s), instead it returned type '
'%s %s #%s: function ' '%s %s #%s: function '
'theano._asarray may need to be modified to handle this ' 'theano._asarray may need to be modified to handle this '
'data type.' % 'data type.' %
(dtype, dtype.str, dtype.num, rval.dtype, rval.str, rval.dtype.num)) (dtype, dtype.str, dtype.num, rval.dtype, rval.str,
rval.dtype.num))
else: else:
return rval return rval
...@@ -184,7 +184,6 @@ whitelist_flake8 = [ ...@@ -184,7 +184,6 @@ whitelist_flake8 = [
"scan_module/scan_opt.py", "scan_module/scan_opt.py",
"scan_module/tests/test_scan.py", "scan_module/tests/test_scan.py",
"scan_module/tests/test_scan_opt.py", "scan_module/tests/test_scan_opt.py",
"misc/safe_asarray.py",
"misc/pycuda_init.py", "misc/pycuda_init.py",
"misc/check_duplicate_key.py", "misc/check_duplicate_key.py",
"misc/tests/test_may_share_memory.py", "misc/tests/test_may_share_memory.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论