Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pytensor/link/jax/dispatch/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Erfinv,
GammaIncCInv,
GammaIncInv,
Hyp2F1,
Iv,
Ive,
Kve,
Expand Down Expand Up @@ -341,3 +342,11 @@ def softplus(x):
)

return softplus


@jax_funcify.register(Hyp2F1)
def jax_funcify_Hyp2F1(op, **kwargs):
def hyp2f1(a, b, c, x):
return jax.scipy.special.hyp2f1(a, b, c, x)

return hyp2f1
20 changes: 20 additions & 0 deletions tests/link/jax/test_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
erfinv,
gammainccinv,
gammaincinv,
hyp2f1,
iv,
kve,
log,
Expand Down Expand Up @@ -324,3 +325,22 @@ def test_jax_logp():
value_test_value,
],
)


def test_jax_hyp2f1():
a = vector("a")
b = vector("b")
c = vector("c")
x = vector("x")
out = hyp2f1(a, b, c, x)

compare_jax_and_py(
[a, b, c, x],
[out],
[
np.array([0.0, 0.0]),
np.array([0.0, 0.0]),
np.array([0.0, 0.0]),
np.array([0.0, 0.0]),
],
)
Loading