提交 4e2b9b54 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

And don't try to use the parent __setstate__ since it doesn't exist.

上级 2aed75fb
...@@ -1367,8 +1367,9 @@ class Assert(T.Op): ...@@ -1367,8 +1367,9 @@ class Assert(T.Op):
self.msg = msg self.msg = msg
def __setstate__(self, attrs): def __setstate__(self, attrs):
self.msg = attrs.pop('msg', "Theano Assert failed!") self.__dict__.update(attrs)
super(Assert, self).__setstate__(attrs) if not hasattr(self, 'msg'):
self.msg = "Theano Assert failed!"
def make_node(self, value, *conds): def make_node(self, value, *conds):
cond = [T.as_tensor_variable(c) for c in conds] cond = [T.as_tensor_variable(c) for c in conds]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论