提交 a384c80d authored 作者: Olivier Mastropietro's avatar Olivier Mastropietro

fixed always False condition

上级 d6cf5c83
......@@ -157,7 +157,7 @@ def local_dimshuffle_alloc(node):
dimshuffle{x, 0, 1}(alloc([3 4], 3, 2) => alloc([3 4], 1, 3, 2)
"""
if isinstance(node.op, T.DimShuffle) and isinstance(node.inputs[0], T.Alloc):
if isinstance(node.op, T.DimShuffle) and isinstance(node.inputs[0].owner.op, T.Alloc):
# check if it only adds dimension to the left
new_order = node.op.new_order
expected_new_order = ('x',) * (len(new_order) - node.inputs[0].ndim) + \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论