提交 721666e2 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix test in DebugMode with recent numpy version. AbsTester with complex input was failing.

上级 5e1295f2
...@@ -868,8 +868,13 @@ class Elemwise(OpenMPOp): ...@@ -868,8 +868,13 @@ class Elemwise(OpenMPOp):
# This is done via the "sig" kwarg of the ufunc, its value # This is done via the "sig" kwarg of the ufunc, its value
# should be something like "ff->f", where the characters # should be something like "ff->f", where the characters
# represent the dtype of the inputs and outputs. # represent the dtype of the inputs and outputs.
# NumPy 1.10.1 raise an error when giving the signature
# when the input is complex. So add it only when inputs is int.
out_dtype = node.outputs[0].dtype out_dtype = node.outputs[0].dtype
if out_dtype in float_dtypes and isinstance(ufunc, numpy.ufunc): if (out_dtype in float_dtypes and
isinstance(ufunc, numpy.ufunc) and
inputs[0].dtype in scalar.int_types):
char = numpy.sctype2char(out_dtype) char = numpy.sctype2char(out_dtype)
sig = char * node.nin + '->' + char * node.nout sig = char * node.nin + '->' + char * node.nout
ufunc_kwargs['sig'] = sig ufunc_kwargs['sig'] = sig
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论