[Solved]Create custom joint probability distribution

I want to do inference for the rat tumor example found in chapter 5 of Bayesian Data Analysis 3rd Edition. The model look like this:

We model the number of rodents which develop tumor as binomial:
y_i ~ Binomial(theta_i, n_i)

The local parameter theta_i has drawn from beta distribution:

theta_i ~ Beta(alpha,beta)

Until this part ,I can do well using pyro. However, in the book they using a weakly informative prior distribution to reflect our ignorance about the true values of alpha and beta.

p(alpha, beta) ∝ (alpha + beta)^(-5/2)

How can I create this joint distribution in pyro? In pymc3 I can use pm.Potential to increment log probability.

@neerajprad has a great solution for it, you can check it here:

Thank you. I am sorry I did not realized the answer already in another forum.