提交 f1444292 authored 作者: Ricardo's avatar Ricardo 提交者: Thomas Wiecki

Fix bug in scalar gammaincc

上级 2f96f2bb
......@@ -592,7 +592,7 @@ class GammaIncC(BinaryScalarOp):
@staticmethod
def st_impl(k, x):
return scipy.special.gammaincc(x, k)
return scipy.special.gammaincc(k, x)
def impl(self, k, x):
return GammaIncC.st_impl(k, x)
......
......@@ -9,7 +9,15 @@ from aesara.link.c.basic import CLinker
from aesara.scalar.math import betainc, betainc_der, gammainc, gammaincc, gammal, gammau
def test_gammainc_nan():
def test_gammainc_python():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammainc(x1, x2)
test_func = function([x1, x2], y, mode=Mode("py"))
assert np.isclose(test_func(1, 2), sp.gammainc(1, 2))
def test_gammainc_nan_c():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammainc(x1, x2)
......@@ -19,7 +27,15 @@ def test_gammainc_nan():
assert np.isnan(test_func(-1, -1))
def test_gammaincc_nan():
def test_gammaincc_python():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammaincc(x1, x2)
test_func = function([x1, x2], y, mode=Mode("py"))
assert np.isclose(test_func(1, 2), sp.gammaincc(1, 2))
def test_gammaincc_nan_c():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammaincc(x1, x2)
......@@ -29,7 +45,7 @@ def test_gammaincc_nan():
assert np.isnan(test_func(-1, -1))
def test_gammal_nan():
def test_gammal_nan_c():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammal(x1, x2)
......@@ -39,7 +55,7 @@ def test_gammal_nan():
assert np.isnan(test_func(-1, -1))
def test_gammau_nan():
def test_gammau_nan_c():
x1 = aet.dscalar()
x2 = aet.dscalar()
y = gammau(x1, x2)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论