提交 642b26b1 authored 作者: Frederic's avatar Frederic

fix missing view_map in a case.

上级 85009eef
...@@ -21,6 +21,10 @@ class DiffOp(theano.Op): ...@@ -21,6 +21,10 @@ class DiffOp(theano.Op):
def __init__(self, n=1, axis=-1): def __init__(self, n=1, axis=-1):
self.n = n self.n = n
self.axis = axis self.axis = axis
# numpy return a view in that case.
# TODO, make an optimization that remove this op in this case.
if n == 0:
self.view_map = {0: [0]}
def __eq__(self, other): def __eq__(self, other):
return (type(self) == type(other) and return (type(self) == type(other) and
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论