提交 d7b03001 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Make isnan return 1 instead of -1 on some Windows

上级 7090cf73
...@@ -1151,7 +1151,13 @@ class IsNan(FixedLogicalComparison): ...@@ -1151,7 +1151,13 @@ class IsNan(FixedLogicalComparison):
(z,) = outputs (z,) = outputs
if node.inputs[0].type in complex_types: if node.inputs[0].type in complex_types:
raise NotImplementedError() raise NotImplementedError()
return "%(z)s = isnan(%(x)s);" % locals() # Windows tries to be different and sometimes return -1, but we want
# to be consistent with numpy (which returns True), hence the "abs".
return "%(z)s = abs(isnan(%(x)s));" % locals()
def c_code_cache_version(self):
scalarop_version = super(IsNan, self).c_code_cache_version()
return tuple(scalarop_version) + (2,)
isnan = IsNan() isnan = IsNan()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论