Gamma distribution modeling concentration and rate - Predictive error

Here’s the last output for (value, concentration, rate, theta, theta.dtype):
(tensor([0.]), tensor([2.5642], grad_fn=<ExpandBackward>), tensor([5.2943], grad_fn=<ExpandBackward>), tensor([0.3997], grad_fn=<ExpandBackward>), torch.float64).

All of those are reasonable values. The log_prob function returned -0.9170, again the expected calculation. I saw another thread where setting dtype to float64 fixed his issue. I added torch.set_default_tensor_type(torch.DoubleTensor) and also added .double() for mu, shape, theta, obs=y.double(), and ret. Still same error. That other thread is very similar to my issue - gamma, torch.exp(), and NaN but that fix doesn’t seem to be working for me.

I also clamped log_prob with a min of -5 to see if that would work and that does not either.

Is there a function after log_prob I should look into next?