Allow sampling the posterior given different `x` (batched)
Is your feature request related to a problem?
I would like to sample the posterior distribution given many x_o (amortization). This is also done in SBC. Currently, this requires a for-loop over x. I think it would be nice to have an option to sample batches of x. This should be possible for any kind of sampler we have (including VI, MCMC, Direct,...)
Describe the solution you'd like
To avoid the hassle of having to decide whether the x are supposed to be i.i.d. or multi-d or just a batch over which to amortize, I would suggest to have a separate sampling method for this, e.g. def sample_amortized()
Note that nflows (and sbi posteriors) enable passing a batch of conditions to sample. The return shape is
(num_conditions, num_samples, x_shape) = flow.sample(num_samples, condition)
with condition.shape=(num_conditions, x_shape).
will be fixed with #1153