Simple Probablity Estimation

If I have a uniform distribution X = uniform(100,300)
I want to compute probability P(X > 150 and X <= 250 ) which should be ideally 0.333
what is the best of day to do it pyro.

Pardon me if it is a stupid question, I am completely new to probabilistic programming.

@jeevan You can use cdf method of distributions:

from torch.distributions import Uniform

d = Uniform(100, 300)
d.cdf(torch.tensor(250.)) - d.cdf(torch.tensor(150.))

Thanks a lot @fehiepsi