class_docstr: Rejection sampled distribution given an acceptance rate function.
  
  :param Distribution propose: A proposal distribution that samples batched
      proposals via ``propose()``. :meth:`rsample` supports a ``sample_shape``
      arg only if ``propose()`` supports a ``sample_shape`` arg.
  :param callable log_prob_accept: A callable that inputs a batch of
      proposals and returns a batch of log acceptance probabilities.
  :param log_scale: Total log probability of acceptance.
class_docstr_tok: ["Rejection","sampled","distribution","given","an","acceptance","rate","function",".",":","param","Distribution","propose",":","A","proposal","distribution","that","samples","batched","proposals","via","``","propose","(",")","``",".",":","meth",":","`","rsample","`","supports","a","``","sample_shape","``","arg","only","if","``","propose","(",")","``","supports","a","``","sample_shape","``","arg",".",":","param","callable","log_prob_accept",":","A","callable","that","inputs","a","batch","of","proposals","and","returns","a","batch","of","log","acceptance","probabilities",".",":","param","log_scale",":","Total","log","probability","of","acceptance","."]
code: def __init__(
      self,
      propose,
      log_prob_accept,
      log_scale,
      *,
      batch_shape=None,
      event_shape=None,
  ):
      self.propose = propose
      self.log_prob_accept = log_prob_accept
      self._log_scale = log_scale
      if batch_shape is None:
          batch_shape = propose.batch_shape
      if event_shape is None:
          event_shape = propose.event_shape
      super().__init__(batch_shape, event_shape)
  
      # These LRU(1) caches allow work to be shared across different method calls.
      self._log_prob_accept_cache = None, None
      self._propose_log_prob_cache = None, None
  
file_path: pyro/pyro/distributions/rejector.py
imports: import torch
  from pyro.distributions.score_parts import ScoreParts
  from pyro.distributions.torch_distribution import TorchDistribution
label_desc: Use image node_id 1 to create a new Rejector object from inherited base classes: TorchDistribution with example: obj = Rejector(propose, log_prob_accept, log_scale)