tfg.math.math_helpers.factorial

Computes the factorial of n.

In the following, A1 to An are optional batch dimensions.

n A tensor of shape [A1, ..., An].

A tensor of shape [A1, ..., An].