提交 1f3ace65 authored 作者: Frederic's avatar Frederic

fix compilation on the CPU.

上级 0ebc21cc
...@@ -558,13 +558,14 @@ class Chi2SF(BinaryScalarOp): ...@@ -558,13 +558,14 @@ class Chi2SF(BinaryScalarOp):
{ {
return 1 - GammaP(k/2., x/2.); return 1 - GammaP(k/2., x/2.);
} }
#endif
""") """)
def c_code(self, node, name, inp, out, sub): def c_code(self, node, name, inp, out, sub):
x, k = inp x, k = inp
z, = out z, = out
if node.inputs[0].type in float_types: if node.inputs[0].type in float_types:
dtype = node.outputs[0].dtype dtype = 'npy_' + node.outputs[0].dtype
return """%(z)s = return """%(z)s =
(%(dtype)s)Chi2SF(%(k)s, %(x)s);""" % locals() (%(dtype)s)Chi2SF(%(k)s, %(x)s);""" % locals()
raise NotImplementedError('only floatingpoint is implemented') raise NotImplementedError('only floatingpoint is implemented')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论