提交 f6dcb8e5 authored 作者: Frederic's avatar Frederic

Fix name error

上级 3c1025e4
......@@ -4,6 +4,7 @@ and Ops building class (:class:`FromFunctionOp`) and decorator
"""
import copy
import cPickle
import warnings
import theano
......@@ -491,17 +492,20 @@ class FromFunctionOp(gof.Op):
try:
obj = load_back(mod, name)
except (ImportError, KeyError, AttributeError):
raise PicklingError("Can't pickle as_op(), not found as %s.%s" %
(mod, name))
raise cPickle.PicklingError(
"Can't pickle as_op(), not found as %s.%s" %
(mod, name))
else:
if obj is not self:
raise PicklingError("Can't pickle as_op(), not the object "
"at %s.%s" % (mod, name))
raise cPickle.PicklingError(
"Can't pickle as_op(), not the object "
"at %s.%s" % (mod, name))
return load_back, (mod, name)
def _infer_shape(self, node, input_shapes):
return self.__infer_shape(node, input_shapes)
def as_op(itypes, otypes, infer_shape=None):
"""
Decorator that converts a function into a basic Theano op that
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论