提交 03a555db authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Simplified python implementation of isinf and isnan

上级 2288924e
...@@ -780,7 +780,7 @@ neq = NEQ() ...@@ -780,7 +780,7 @@ neq = NEQ()
class IsNan(FixedLogicalComparison): class IsNan(FixedLogicalComparison):
def impl(self, x): def impl(self, x):
return theano._asarray(numpy.isnan(x), dtype='int8') return numpy.isnan(x)
def c_code(self, node, name, (x, ), (z, ), sub): def c_code(self, node, name, (x, ), (z, ), sub):
if node.inputs[0].type in complex_types: if node.inputs[0].type in complex_types:
raise NotImplementedError() raise NotImplementedError()
...@@ -790,7 +790,7 @@ isnan = IsNan() ...@@ -790,7 +790,7 @@ isnan = IsNan()
class IsInf(FixedLogicalComparison): class IsInf(FixedLogicalComparison):
def impl(self, x): def impl(self, x):
return theano._asarray(numpy.isinf(x), dtype='int8') return numpy.isinf(x)
def c_code(self, node, name, (x, ), (z, ), sub): def c_code(self, node, name, (x, ), (z, ), sub):
if node.inputs[0].type in complex_types: if node.inputs[0].type in complex_types:
raise NotImplementedError() raise NotImplementedError()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论