提交 bdcb752a authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix gh-3052, don't build ufunc when not used(We limit to 31 inputs when there is no C compiler)

上级 9c19d300
...@@ -505,7 +505,7 @@ class Elemwise(OpenMPOp): ...@@ -505,7 +505,7 @@ class Elemwise(OpenMPOp):
self.nfunc_spec = nfunc_spec self.nfunc_spec = nfunc_spec
if nfunc_spec: if nfunc_spec:
self.nfunc = getattr(numpy, nfunc_spec[0]) self.nfunc = getattr(numpy, nfunc_spec[0])
elif scalar_op.nin > 0: elif scalar_op.nin > 0 and scalar_op.nin < 32:
self.ufunc = numpy.frompyfunc(scalar_op.impl, scalar_op.nin, self.ufunc = numpy.frompyfunc(scalar_op.impl, scalar_op.nin,
scalar_op.nout) scalar_op.nout)
...@@ -527,7 +527,7 @@ class Elemwise(OpenMPOp): ...@@ -527,7 +527,7 @@ class Elemwise(OpenMPOp):
self.nfunc = None self.nfunc = None
if getattr(self, 'nfunc_spec', None): if getattr(self, 'nfunc_spec', None):
self.nfunc = getattr(numpy, self.nfunc_spec[0]) self.nfunc = getattr(numpy, self.nfunc_spec[0])
elif self.scalar_op.nin > 0: elif self.scalar_op.nin > 0 and self.scalar_op.nin < 32:
self.ufunc = numpy.frompyfunc(self.scalar_op.impl, self.ufunc = numpy.frompyfunc(self.scalar_op.impl,
self.scalar_op.nin, self.scalar_op.nin,
self.scalar_op.nout) self.scalar_op.nout)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论