Why does pyro.sample always return the same value?

As far as I understand, the pyro primitive sample(name, fn, *args, **kwargs) is supposed to randomly sample a data point from my distribution fn. However, this is not the case, as running the following code will always give the same results:

for _ in range(5):
    x = pyro.sample("my_sample", pyro.distributions.Normal(1.,2.))
    print(x)

This will always return

tensor(-1.7810)
tensor(-0.6305)
tensor(0.3591)
tensor(2.4755)
tensor(-2.5067)

It doesn’t make any sense to me… When sampling from a probability distribution I do not want to have sample no. i to always be the same value. Why is that in this case? Have I misunderstood the purpose of this primitive?

Ok nevermind, I just found the answer myself.

The problem was that I set the seed

pyro.set_rng_seed(101)

which determines the sequence of random numbers for reproducibility.