In the intro tutorial it says that we must make sure to pass unique names to pyro.sample() when creating geometric distribution as in:
def geometric(p, t=None):
if t is None:
t = 0
x = pyro.sample("x_{}".format(t), pyro.distributions.Bernoulli(p))
if x.item() == 1:
return 0
else:
return 1 + geometric(p, t + 1)
print(geometric(0.5))
My question is: what’s the point of passing new names? it works just as well when passing same name. No explanation is provided in the tutorial.