jax.scipy.special.factorial#
- jax.scipy.special.factorial(n, exact=False)[source]#
Factorial function
JAX implementation of
scipy.special.factorial
\[\mathrm{factorial}(n) = n! = \prod_{k=1}^n k\]- Parameters:
n (ArrayLike) – arraylike, values for which factorial will be computed elementwise
exact (bool) – bool, only
exact=False
is supported.
- Returns:
array containing values of the factorial.
- Return type:
Notes
This computes the float-valued factorial via the
gamma()
function. JAX does not support exact factorials, because it is not particularly useful: aboven=20
, the exact result cannot be represented by 64-bit integers, which are the largest integers available to JAX.See also