def METHOD_NAME(
    self,
    adata: Optional[AnnData] = None,
    indices: Optional[Sequence[int]] = None,
    give_mean: bool = True,
    n_samples: int = 1,
    batch_size: Optional[int] = None,
) -> np.ndarray:
    r"""Return the latent representation for each cell.
    This is denoted as :math:`z_n` in our manuscripts.
    Parameters
    ----------
    adata
        AnnData object with equivalent structure to initial AnnData. If `None`, defaults to the
        AnnData object used to initialize the model.
    indices
        Indices of cells in adata to use. If `None`, all cells are used.
    give_mean
        Whether to return the mean of the posterior distribution or a sample.
    n_samples
        Number of samples to use for computing the latent representation.
    batch_size
        Minibatch size for data loading into model. Defaults to `scvi.settings.batch_size`.
    Returns
    -------
    latent_representation : np.ndarray
        Low-dimensional representation for each cell
    """
    self._check_if_trained(warn=False)
    adata = self._validate_anndata(adata)
    scdl = self._make_data_loader(
        adata=adata, indices=indices, batch_size=batch_size, iter_ndarray=True
    )
    jit_inference_fn = self.module.get_jit_inference_fn(
        inference_kwargs={"n_samples": n_samples}
    )
    latent = []
    for array_dict in scdl:
        out = jit_inference_fn(self.module.rngs, array_dict)
        if give_mean:
            z = out["qz"].mean
        else:
            z = out["z"]
        latent.append(z)
    concat_axis = 0 if ((n_samples == 1) or give_mean) else 1
    latent = jnp.concatenate(latent, axis=concat_axis)
    return self.module.as_numpy_array(latent)