Let’s say I have two latent variables y,z in model() with factorized priors, e.g.

y = pyro.sample(“y”, …), z = pyro.sample(“z”, …).

How would I able to model the approximate posterior of y and z together, e.g. using a normalizing flow. If I do something like

sample = pyro.sample(“sample”, …)

y = sample[1]

z = sample[2]

I will have an error similar to this:

log_r_term = log_r_term - guide_trace.nodes[name][“log_prob”]

KeyError: ‘y’