We tried the tutorial on GP https://pyro.ai/examples/gp.html

(thank you for the awesome tutorials!)

and we have a few questions:

**1. We could not get these lines to work?**

gpr.kernel.lengthscale = pyro.nn.PyroSample(dist.LogNormal(0.0, 1.))

gpr.kernel.variance = pyro.nn.PyroSample(dist.LogNormal(0.0, 1.))

It says: AttributeError: module ‘pyro.nn’ has no attribute ‘PyroSample’.

Could you please give an example on how to fix this?

**2. We would like to compute log_p, log_q. It looks like we could do this using poutine.**

How does poutine work with GPRegression or SparseGPRegression in the lines below?

What shape of data should we pass in get_trace(data)? is it a tuple data=(X,y)?

model_trace = pyro.poutine.trace(gpr.model).get_trace(data)

guide_trace = pyro.poutine.trace(gpr.guide).get_trace(data)

**3. If we pass data=None in the lines above, how does it compute log_prob_sum()?**

(ie. how does it do the random sampling?)

log_p = model_trace.log_prob_sum()

log_q = guide_trace.log_prob_sum()