提交 2beab0e4 authored 作者: Hengjean's avatar Hengjean

Updated version in c cache. check_input should now be propagating.

上级 acb2a9d0
...@@ -284,6 +284,9 @@ class Shape(gof.Op): ...@@ -284,6 +284,9 @@ class Shape(gof.Op):
return () return ()
version.append((str(t), v)) version.append((str(t), v))
if version:
version.append(1)
return tuple(version) return tuple(version)
......
...@@ -325,20 +325,32 @@ def get_c_init(r, name, sub): ...@@ -325,20 +325,32 @@ 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 r.owner:
c_extract = r.type.c_extract(name, sub,
getattr(r.owner.op, 'check_input', True))
else:
c_extract = r.type.c_extract(name, sub)
pre = """ pre = """
py_%(name)s = PyList_GET_ITEM(storage_%(name)s, 0); py_%(name)s = PyList_GET_ITEM(storage_%(name)s, 0);
{Py_XINCREF(py_%(name)s);} {Py_XINCREF(py_%(name)s);}
""" % locals() """ % locals()
return pre + r.type.c_extract(name, sub) return pre + c_extract
def get_c_extract_out(r, name, sub): def get_c_extract_out(r, name, sub):
"""Wrapper around c_extract_out that initializes py_name from storage.""" """Wrapper around c_extract_out that initializes py_name from storage."""
if r.owner:
c_extract = r.type.c_extract(name, sub,
getattr(r.owner.op, 'check_input', True))
else:
c_extract = r.type.c_extract(name, sub)
pre = """ pre = """
py_%(name)s = PyList_GET_ITEM(storage_%(name)s, 0); py_%(name)s = PyList_GET_ITEM(storage_%(name)s, 0);
{Py_XINCREF(py_%(name)s);} {Py_XINCREF(py_%(name)s);}
""" % locals() """ % locals()
return pre + r.type.c_extract_out(name, sub) return pre + c_extract
def get_c_cleanup(r, name, sub): def get_c_cleanup(r, name, sub):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论