提交 c9a0def3 authored 作者: James Bergstra's avatar James Bergstra

PEP8 whitespace

上级 9612b7d9
...@@ -154,15 +154,19 @@ class Gemv(Op): ...@@ -154,15 +154,19 @@ class Gemv(Op):
self.inplace=inplace self.inplace=inplace
if inplace: if inplace:
self.destroy_map={0:[0]} self.destroy_map={0:[0]}
def __eq__(self, other): def __eq__(self, other):
return type(self)==type(other) and self.inplace == other.inplace return type(self)==type(other) and self.inplace == other.inplace
def __str__(self): def __str__(self):
if self.inplace: if self.inplace:
return 'Gemv{inplace}' return 'Gemv{inplace}'
else: else:
return 'Gemv{no_inplace}' return 'Gemv{no_inplace}'
def __hash__(self): def __hash__(self):
return hash(type(self)) ^ hash(self.inplace) return hash(type(self)) ^ hash(self.inplace)
def make_node(self, y, alpha, A, x, beta): def make_node(self, y, alpha, A, x, beta):
y = T.as_tensor_variable(y) y = T.as_tensor_variable(y)
x = T.as_tensor_variable(x) x = T.as_tensor_variable(x)
...@@ -181,6 +185,7 @@ class Gemv(Op): ...@@ -181,6 +185,7 @@ class Gemv(Op):
#if x.broadcastable[0] != A.broadcastable[1]: #if x.broadcastable[0] != A.broadcastable[1]:
#raise TypeError('broadcastable mismatch between x and A', (x.type, A.type)) #raise TypeError('broadcastable mismatch between x and A', (x.type, A.type))
return Apply(self, [y, alpha, A, x, beta], [y.type()]) return Apply(self, [y, alpha, A, x, beta], [y.type()])
def perform(self, node, inputs, out_storage): def perform(self, node, inputs, out_storage):
y, alpha, A, x, beta = inputs y, alpha, A, x, beta = inputs
if _have_fblas: if _have_fblas:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论