提交 24678d0f authored 作者: James Bergstra's avatar James Bergstra

bug fix: corrected view_map of CSMGrad with kmap != None

上级 d0821805
...@@ -378,6 +378,8 @@ CSR = CSM('csr') ...@@ -378,6 +378,8 @@ CSR = CSM('csr')
class CSMGrad(gof.op.Op): class CSMGrad(gof.op.Op):
def __init__(self, kmap=None): def __init__(self, kmap=None):
self.kmap = kmap self.kmap = kmap
if self.kmap is None:
self.view_map = {0 : [1]}
def __eq__(self, other): def __eq__(self, other):
return type(self) == type(other) and _kmap_eq(self.kmap, other.kmap) return type(self) == type(other) and _kmap_eq(self.kmap, other.kmap)
......
...@@ -211,7 +211,7 @@ class test_structureddot(unittest.TestCase): ...@@ -211,7 +211,7 @@ class test_structureddot(unittest.TestCase):
assert _is_dense(c) assert _is_dense(c)
assert numpy.all(outvals == c) assert numpy.all(outvals == c)
tensor.verify_grad(None, buildgraphCSR, [kernvals,imvals]) tensor.verify_grad( buildgraphCSR, [kernvals,imvals])
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论