提交 4262fc20 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix crash, tests

上级 8a8bfaaa
......@@ -132,6 +132,16 @@ class Apply(Node):
return self.op.get_context(self)
return NoContext
def __getstate__(self):
d = self.__dict__
# ufunc don't pickle/unpickle well
if hasattr(self.tag, 'ufunc'):
d = copy(self.__dict__)
t = d["tag"]
del t.ufunc
d["tag"] = t
return d
def default_output(self):
"""
Returns the default output for this node.
......
......@@ -798,9 +798,9 @@ class Elemwise(OpenMPOp):
# NumPy ufunc support only up to 31 inputs.
# But our c code support more.
if (len(node.inputs) < 32 and
(self.nfunc is None or
self.scalar_op.nin != len(node.inputs)) and
self.ufunc is None):
(self.nfunc is None or
self.scalar_op.nin != len(node.inputs)) and
self.ufunc is None):
ufunc = numpy.frompyfunc(self.scalar_op.impl,
len(node.inputs),
......@@ -814,7 +814,6 @@ class Elemwise(OpenMPOp):
return super(Elemwise, node_.op).make_thunk(node_, storage_map,
compute_map, no_recycling)
def perform(self, node, inputs, output_storage):
if len(node.inputs) >= 32:
# Some versions of NumPy will segfault, other will raise a
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论