class_docstr: Compound distribution comprising of a gamma-poisson pair, also referred to as
  a gamma-poisson mixture. The ``rate`` parameter for the
  :class:`~pyro.distributions.Poisson` distribution is unknown and randomly
  drawn from a :class:`~pyro.distributions.Gamma` distribution.
  
  .. note:: This can be treated as an alternate parametrization of the
      :class:`~pyro.distributions.NegativeBinomial` (``total_count``, ``probs``)
      distribution, with `concentration = total_count` and `rate = (1 - probs) / probs`.
  
  :param float or torch.Tensor concentration: shape parameter (alpha) of the Gamma
      distribution.
  :param float or torch.Tensor rate: rate parameter (beta) for the Gamma
      distribution.
class_docstr_tok: ["Compound","distribution","comprising","of","a","gamma-poisson","pair",",","also","referred","to","as","a","gamma-poisson","mixture",".","The","``","rate","``","parameter","for","the",":","class",":","`","~pyro.distributions.Poisson","`","distribution","is","unknown","and","randomly","drawn","from","a",":","class",":","`","~pyro.distributions.Gamma","`","distribution",".","..","note",":",":","This","can","be","treated","as","an","alternate","parametrization","of","the",":","class",":","`","~pyro.distributions.NegativeBinomial","`","(","``","total_count","``",",","``","probs","``",")","distribution",",","with","`","concentration","=","total_count","`","and","`","rate","=","(","1","-","probs",")","\/","probs","`",".",":","param","float","or","torch.Tensor","concentration",":","shape","parameter","(","alpha",")","of","the","Gamma","distribution",".",":","param","float","or","torch.Tensor","rate",":","rate","parameter","(","beta",")","for","the","Gamma","distribution","."]
code: def sample(self, sample_shape=()):
      rate = self._gamma.sample(sample_shape)
      return Poisson(rate).sample()
  
imports: import numbers
  import torch
  from torch.distributions.utils import broadcast_all
  from pyro.ops.special import log_beta, log_binomial
  from .None import constraints
  from .torch import Beta, Binomial, Dirichlet, Gamma, Multinomial, Poisson
  from .torch_distribution import TorchDistribution
  from .util import broadcast_shape
label_desc: Use image node_id 5 for calling the GammaPoisson obj's underlying member method code with example usage: obj.sample(sample_shape) and returns: Poisson