class_docstr: Generic Zero Inflated distribution.
  
  This can be used directly or can be used as a base class as e.g. for
  :class:`ZeroInflatedPoisson` and :class:`ZeroInflatedNegativeBinomial`.
  
  :param torch.Tensor gate: probability of extra zeros given via a Bernoulli distribution.
  :param TorchDistribution base_dist: the base distribution.
code: def expand(self, batch_shape, _instance=None):
      new = self._get_checked_instance(type(self), _instance)
      batch_shape = torch.Size(batch_shape)
      gate = self.gate.expand(batch_shape)
      base_dist = self.base_dist.expand(batch_shape)
      ZeroInflatedDistribution.__init__(
          new, gate, base_dist, validate_args=False
      )
      new._validate_args = self._validate_args
      return new
  
imports: import torch
  from torch.distributions import constraints, NegativeBinomial, Poisson, Distribution
  from torch.distributions.utils import broadcast_all, lazy_property
  from .utils import broadcast_shape
label_desc: Use image node_id 7 for calling the ZeroInflatedDistribution obj's underlying member method code with example usage: obj.expand(batch_shape, _instance) and returns: new