提交 ee15333f authored 作者: --global's avatar --global

Call validation function from __setstate__() and make_thunk()

上级 8869aeb1
...@@ -211,6 +211,7 @@ class Scan(PureOp): ...@@ -211,6 +211,7 @@ class Scan(PureOp):
def __setstate__(self, d): def __setstate__(self, d):
self.__dict__.update(d) self.__dict__.update(d)
self.validate_inner_graph()
if "allow_gc" not in self.__dict__: if "allow_gc" not in self.__dict__:
self.allow_gc = True self.allow_gc = True
self.info['allow_gc'] = True self.info['allow_gc'] = True
...@@ -584,6 +585,11 @@ class Scan(PureOp): ...@@ -584,6 +585,11 @@ class Scan(PureOp):
the thunk can potentially cache return values (like CLinker does), the thunk can potentially cache return values (like CLinker does),
then it must not do so for variables in the no_recycling list. then it must not do so for variables in the no_recycling list.
""" """
# Before building the thunk, validate that the inner graph is
# coherent
self.validate_inner_graph()
# Setting up all my variables in what I believe is a more Cython # Setting up all my variables in what I believe is a more Cython
# friendly form # friendly form
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论