Hi ccook!



 ccook:

Is there a way to do factorials that will work with cuda?


Yes.  The Euler gamma function is essentially the factorial function.
Because it grows so fast we often use the logarithm of the gamma
function for numerical work.  Pytorch provides torch.lgamma() 1, a
full-featured, cuda-enabled, autograd-enabled pytorch tensor function.
Best.
K. Frank