Do you think it is possible to workaround it using theano.tensor.gamma or theano.tensor.gammaln?
theano.tensor.gamma
theano.tensor.gammaln