class_docstr: Compound distribution comprising of a beta-binomial pair. The probability of
  success (``probs`` for the :class:`~pyro.distributions.Binomial` distribution)
  is unknown and randomly drawn from a :class:`~pyro.distributions.Beta` distribution
  prior to a certain number of Bernoulli trials given by ``total_count``.
  
  :param concentration1: 1st concentration parameter (alpha) for the
      Beta distribution.
  :type concentration1: float or torch.Tensor
  :param concentration0: 2nd concentration parameter (beta) for the
      Beta distribution.
  :type concentration0: float or torch.Tensor
  :param total_count: Number of Bernoulli trials.
  :type total_count: float or torch.Tensor
class_docstr_tok: ["Compound","distribution","comprising","of","a","beta-binomial","pair",".","The","probability","of","success","(","``","probs","``","for","the",":","class",":","`","~pyro.distributions.Binomial","`","distribution",")","is","unknown","and","randomly","drawn","from","a",":","class",":","`","~pyro.distributions.Beta","`","distribution","prior","to","a","certain","number","of","Bernoulli","trials","given","by","``","total_count","``",".",":","param","concentration1",":","1st","concentration","parameter","(","alpha",")","for","the","Beta","distribution",".",":","type","concentration1",":","float","or","torch.Tensor",":","param","concentration0",":","2nd","concentration","parameter","(","beta",")","for","the","Beta","distribution",".",":","type","concentration0",":","float","or","torch.Tensor",":","param","total_count",":","Number","of","Bernoulli","trials",".",":","type","total_count",":","float","or","torch.Tensor"]
code: def expand(self, batch_shape, _instance=None):
      new = self._get_checked_instance(BetaBinomial, _instance)
      batch_shape = torch.Size(batch_shape)
      new._beta = self._beta.expand(batch_shape)
      new.total_count = self.total_count.expand_as(
          new._beta.concentration0
      )
      super(BetaBinomial, new).__init__(
          batch_shape, validate_args=False
      )
      new._validate_args = self._validate_args
      return new
  
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 4 for calling the BetaBinomial obj's underlying member method code with example usage: obj.expand(batch_shape, _instance) and returns: new