How does "vectorize_particles" work?

The loss function Trace_ELBO has an argument called vectorize_particles.
If I understand that argument correctly it enables the vectorization of the evaluation of multiple samples from the ELBO.
However, when I’m enabling it, it seems to add another dimension to my minibatches which has the size of the number of particles. My question is: How do I go from there? How do I tell my model and the inference algorithm to use this dimension for the particles?
Maybe someone can provide a minimal example of its usage?

Thank you!

Hi, you don’t need to do anything except pass vectorize_particles=True and num_particles=N to the ELBO constructor, e.g. Trace_ELBO(num_particles=100, vectorize_particles=True); the ELBO implementation will automatically create an extra batch dimension in your model and guide and average over this dimension when computing the ELBO estimate.