class_docstr: Encapsulate Pyro specific logic.
docstr: Convert the posterior to an xarray dataset.
docstr_tok: ["Convert","the","posterior","to","an","xarray","dataset","."]
code: def posterior_to_xarray(self):
      """Convert the posterior to an xarray dataset."""
      data = self.posterior.get_samples(group_by_chain=True)
      data = {k: v.detach().cpu().numpy() for k, v in data.items()}
      return dict_to_dataset(
          data, library=self.pyro, coords=self.coords, dims=self.dims
      )
  
imports: import logging
  from typing import Callable, Optional
  import warnings
  import numpy
  from packaging import version
  from ..None import utils
  from ..rcparams import rcParams
  from .base import dict_to_dataset, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 2 for calling the PyroConverter obj's underlying member method code with example usage: obj.posterior_to_xarray() and returns: dict_to_dataset