Setup beta prior distribution using pyro

I was trying to following this example implemented in Pyro,

while setting up the prior distribution,

prior = dist.Beta(10, 10)
plt.figure(num=None, figsize=(10, 6), dpi=80)
x_range = np.linspace(0, 1, num=100)
y_values = torch.exp(prior.log_prob(torch.tensor(x_range)))

I am not clear why we have to compute log_probability first and then apply exponential to generate y_value.

pyro/pytorch probability distributions do not have prob methods they just have log_prob methods (among other things, this is usually numerically stabler)