On the partition function of non-perturbative gravity