class_docstr: Wraps a Zuko distribution as a Pyro distribution.
  
  If ``dist`` has an ``rsample_and_log_prob`` method, like Zuko's flows, it will be
  used when sampling instead of ``rsample``. The returned log density will be cached
  for later scoring.
  
  :param dist: A distribution instance.
  :type dist: torch.distributions.Distribution
  
  .. code-block:: python
  
      flow = zuko.flows.MAF(features=5)
  
      # flow() is a torch.distributions.Distribution
  
      dist = flow()
      x = dist.sample((2, 3))
      log_p = dist.log_prob(x)
  
      # ZukoToPyro(flow()) is a pyro.distributions.Distribution
  
      dist = ZukoToPyro(flow())
      x = dist((2, 3))
      log_p = dist.log_prob(x)
  
      with pyro.plate("data", 42):
          z = pyro.sample("z", dist)
code: def __init__(self, dist: torch.distributions.Distribution):
      self.dist = dist
      self.cache = {}
  
file_path: pyro/pyro/contrib/zuko.py
imports: import torch
  from torch import Size, Tensor
  import pyro
label_desc: Use image node_id 1 to create a new ZukoToPyro object from inherited base classes: pyro.distributions with example: obj = ZukoToPyro(dist)