提交 0dec0a90 authored 作者: Olivier Mastropietro's avatar Olivier Mastropietro

Fixed the if condition if op has no owner

上级 78362f80
...@@ -106,14 +106,14 @@ def local_max_to_min(node): ...@@ -106,14 +106,14 @@ def local_max_to_min(node):
def local_alloc_dimshuffle(node): def local_alloc_dimshuffle(node):
if node.op == T.alloc: if node.op == T.alloc:
input_ = node.inputs[0] input_ = node.inputs[0]
if isinstance(input_.owner.op, DimShuffle): if getattr(input_, 'owner', None) and isinstance(input_.owner.op, DimShuffle):
# check if it only adds dimension to the left # check if it only adds dimension to the left
pattern = input_.type.broadcastable pattern = input_.type.broadcastable
if not pattern[0] : if not pattern[0]:
return False return False
j = 0 j = 0
for i, bool_ in enumerate(pattern): for i, bool_ in enumerate(pattern):
if not bool_ : if not bool_:
j = i j = i
break break
if sum(pattern[j:]) == 0: if sum(pattern[j:]) == 0:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论