提交 87346325 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix case where 'output' is a client

This happens when linker=CLinker
上级 c89e1bc2
...@@ -282,10 +282,13 @@ def get_nothing(r, name, sub): ...@@ -282,10 +282,13 @@ def get_nothing(r, name, sub):
def get_c_declare(r, name, sub): def get_c_declare(r, name, sub):
"""Wrapper around c_declare that declares py_name""" """Wrapper around c_declare that declares py_name"""
if any([c != "output" and getattr(c.op, 'check_input', if any([c != "output" and getattr(c.op, 'check_input',
config.check_input) for (c, _) in r.clients]) or ( config.check_input) for (c, _) in r.clients]) or (
r.owner and getattr(r.owner.op, 'check_input', True)): r.owner and getattr(r.owner.op, 'check_input', True)):
#if any([getattr(c.op, 'check_input', config.check_input)
# for (c, _) in r.clients
# if not isinstance(c, string_types)]) or (r.owner
c_declare = r.type.c_declare(name, sub, True) c_declare = r.type.c_declare(name, sub, True)
else: else:
c_declare = r.type.c_declare(name, sub, False) c_declare = r.type.c_declare(name, sub, False)
...@@ -306,13 +309,15 @@ def get_c_init(r, name, sub): ...@@ -306,13 +309,15 @@ def get_c_init(r, name, sub):
def get_c_extract(r, name, sub): def get_c_extract(r, name, sub):
"""Wrapper around c_extract that initializes py_name from storage.""" """Wrapper around c_extract that initializes py_name from storage."""
if any([getattr(c.op, 'check_input', config.check_input) for (c, _) in if any([getattr(c.op, 'check_input', config.check_input)
r.clients]): for (c, _) in r.clients
if not isinstance(c, string_types)]):
# check_broadcast is just an hack to easily remove just the # check_broadcast is just an hack to easily remove just the
# broadcast check on the old GPU back-end. This check isn't # broadcast check on the old GPU back-end. This check isn't
# done in the new GPU back-end or on the CPU. # done in the new GPU back-end or on the CPU.
if any([getattr(c.op, 'check_broadcast', True) for (c, _) in if any([getattr(c.op, 'check_broadcast', True)
r.clients]): for (c, _) in r.clients
if not isinstance(c, string_types)]):
c_extract = r.type.c_extract(name, sub, True) c_extract = r.type.c_extract(name, sub, True)
else: else:
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论