提交 453ad8f1 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for tensor/sharedvar.py

上级 5aebc410
...@@ -41,10 +41,10 @@ def tensor_constructor(value, name=None, strict=False, allow_downcast=None, ...@@ -41,10 +41,10 @@ def tensor_constructor(value, name=None, strict=False, allow_downcast=None,
broadcastable = (False,) * len(value.shape) broadcastable = (False,) * len(value.shape)
type = TensorType(value.dtype, broadcastable=broadcastable) type = TensorType(value.dtype, broadcastable=broadcastable)
return TensorSharedVariable(type=type, return TensorSharedVariable(type=type,
value=numpy.array(value, copy=(not borrow)), value=numpy.array(value, copy=(not borrow)),
name=name, name=name,
strict=strict, strict=strict,
allow_downcast=allow_downcast) allow_downcast=allow_downcast)
# TensorSharedVariable brings in the tensor operators, is not ideal, but works # TensorSharedVariable brings in the tensor operators, is not ideal, but works
...@@ -85,8 +85,10 @@ def scalar_constructor(value, name=None, strict=False, allow_downcast=None, ...@@ -85,8 +85,10 @@ def scalar_constructor(value, name=None, strict=False, allow_downcast=None,
# Do not pass the dtype to asarray because we want this to fail if # Do not pass the dtype to asarray because we want this to fail if
# strict is True and the types do not match. # strict is True and the types do not match.
rval = ScalarSharedVariable(type=tensor_type, rval = ScalarSharedVariable(type=tensor_type,
value=numpy.array(value, copy=True), value=numpy.array(value, copy=True),
name=name, strict=strict, allow_downcast=allow_downcast) name=name,
strict=strict,
allow_downcast=allow_downcast)
return rval return rval
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
......
...@@ -57,7 +57,6 @@ whitelist_flake8 = [ ...@@ -57,7 +57,6 @@ whitelist_flake8 = [
"typed_list/tests/test_type.py", "typed_list/tests/test_type.py",
"typed_list/tests/test_opt.py", "typed_list/tests/test_opt.py",
"typed_list/tests/test_basic.py", "typed_list/tests/test_basic.py",
"tensor/sharedvar.py",
"tensor/inplace.py", "tensor/inplace.py",
"tensor/slinalg.py", "tensor/slinalg.py",
"tensor/shared_randomstreams.py", "tensor/shared_randomstreams.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论