提交 e503b3f0 authored 作者: Frederic's avatar Frederic

pep8

上级 08d16c0a
......@@ -289,6 +289,7 @@ DEVICE double _psi(double x){
return hash(type(self))
psi = Psi(upgrade_to_float, name='psi')
class Chi2SF(BinaryScalarOp):
"""
Compute (1 - chi2_cdf(x))
......@@ -298,11 +299,13 @@ class Chi2SF(BinaryScalarOp):
@staticmethod
def st_impl(x, k):
return scipy.stats.chi2.sf(x, k)
def impl(self, x, k):
if imported_scipy_special:
return Chi2SF.st_impl(x, k)
else:
super(Chi2SF, self).impl(x, k)
def c_support_code(self):
return(
"""
......@@ -557,9 +560,7 @@ class Chi2SF(BinaryScalarOp):
}
""")
def c_code(self, node, name, inp, out, sub):
x, k = inp
z, = out
if node.inputs[0].type in float_types:
......@@ -570,6 +571,7 @@ class Chi2SF(BinaryScalarOp):
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论