提交 b504c51f authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 for type.py

上级 e4ae792a
...@@ -184,7 +184,7 @@ class GpuArrayType(Type): ...@@ -184,7 +184,7 @@ class GpuArrayType(Type):
@staticmethod @staticmethod
def may_share_memory(a, b): def may_share_memory(a, b):
if (not isinstance(a, gpuarray.GpuArray) or if (not isinstance(a, gpuarray.GpuArray) or
not isinstance(b, gpuarray.GpuArray)): not isinstance(b, gpuarray.GpuArray)):
return False return False
return pygpu.gpuarray.may_share_memory(a, b) return pygpu.gpuarray.may_share_memory(a, b)
...@@ -200,7 +200,8 @@ class GpuArrayType(Type): ...@@ -200,7 +200,8 @@ class GpuArrayType(Type):
self.broadcastable == other.broadcastable) self.broadcastable == other.broadcastable)
def convert_variable(self, var): def convert_variable(self, var):
if (type(self) == type(var.type) and vt = var.type
if (type(self) == type(vt) and
self.typecode == var.type.typecode and self.typecode == var.type.typecode and
self.ndim == var.type.ndim and self.ndim == var.type.ndim and
all(sb == ob or ob for sb, ob in zip(self.broadcastable, all(sb == ob or ob for sb, ob in zip(self.broadcastable,
......
...@@ -157,7 +157,6 @@ whitelist_flake8 = [ ...@@ -157,7 +157,6 @@ whitelist_flake8 = [
"sandbox/linalg/ops.py", "sandbox/linalg/ops.py",
"sandbox/linalg/__init__.py", "sandbox/linalg/__init__.py",
"sandbox/linalg/tests/test_linalg.py", "sandbox/linalg/tests/test_linalg.py",
"sandbox/gpuarray/type.py",
"sandbox/gpuarray/__init__.py", "sandbox/gpuarray/__init__.py",
"sandbox/gpuarray/kernel_codegen.py", "sandbox/gpuarray/kernel_codegen.py",
"sandbox/gpuarray/conv.py", "sandbox/gpuarray/conv.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论