class_docstr: A Posterior represented by a list of independent Posteriors.
  
  When at least one of the posteriors is a `GaussianMixturePosterior`, the other
  posteriors are expanded to match the size of the `GaussianMixturePosterior`.
class_docstr_tok: ["A","Posterior","represented","by","a","list","of","independent","Posteriors",".","When","at","least","one","of","the","posteriors","is","a","`","GaussianMixturePosterior","`",",","the","other","posteriors","are","expanded","to","match","the","size","of","the","`","GaussianMixturePosterior","`","."]
docstr: Sample from the posterior (with gradients).
  
  Args:
      sample_shape: A `torch.Size` object specifying the sample shape. To
          draw `n` samples, set to `torch.Size([n])`. To draw `b` batches
          of `n` samples each, set to `torch.Size([b, n])`.
      base_samples: An (optional) Tensor of `N(0, I)` base samples of
          appropriate dimension, typically obtained from a `Sampler`.
          This is used for deterministic optimization. Deprecated.
  
  Returns:
      Samples from the posterior, a tensor of shape
      `self._extended_shape(sample_shape=sample_shape)`.
docstr_tok: ["Sample","from","the","posterior","(","with","gradients",")",".","Args",":","sample_shape",":","A","`","torch.Size","`","object","specifying","the","sample","shape",".","To","draw","`","n","`","samples",",","set","to","`","torch.Size","(","[","n","]",")","`",".","To","draw","`","b","`","batches","of","`","n","`","samples","each",",","set","to","`","torch.Size","(","[","b",",","n","]",")","`",".","base_samples",":","An","(","optional",")","Tensor","of","`","N","(","0",",","I",")","`","base","samples","of","appropriate","dimension",",","typically","obtained","from","a","`","Sampler","`",".","This","is","used","for","deterministic","optimization",".","Deprecated",".","Returns",":","Samples","from","the","posterior",",","a","tensor","of","shape","`","self._extended_shape","(","sample_shape=sample_shape",")","`","."]
code: def rsample(
      self,
      sample_shape: Optional[torch.Size] = None,
  ) -> Tensor:
      r"""Sample from the posterior (with gradients).
  
      Args:
          sample_shape: A `torch.Size` object specifying the sample shape. To
              draw `n` samples, set to `torch.Size([n])`. To draw `b` batches
              of `n` samples each, set to `torch.Size([b, n])`.
          base_samples: An (optional) Tensor of `N(0, I)` base samples of
              appropriate dimension, typically obtained from a `Sampler`.
              This is used for deterministic optimization. Deprecated.
  
      Returns:
          Samples from the posterior, a tensor of shape
          `self._extended_shape(sample_shape=sample_shape)`.
      """
      samples = [
          p.rsample(sample_shape=sample_shape) for p in self.posteriors
      ]
      return self._reshape_and_cat(tensors=samples)
  
imports: from __future__ import annotations
  from functools import cached_property
  from typing import Any, List, Optional
  import torch
  from botorch.posteriors.fully_bayesian import GaussianMixturePosterior, MCMC_DIM
  from botorch.posteriors.posterior import Posterior
  from torch import Tensor
label_desc: Use image node_id 11 for calling the PosteriorList obj's underlying member method code with example usage: obj.rsample(sample_shape) and returns: self