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 __init__(self, gate, base_dist, validate_args=None):
      if base_dist.event_shape:
          raise ValueError(
              "ZeroInflatedDistribution expected empty "
              "base_dist.event_shape but got {}".format(
                  base_dist.event_shape
              )
          )
      batch_shape = broadcast_shape(gate.shape, base_dist.batch_shape)
      self.gate = gate.expand(batch_shape)
      self.base_dist = base_dist.expand(batch_shape)
      event_shape = torch.Size()
  
      super().__init__(batch_shape, event_shape, validate_args)
  
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 1 to create a new ZeroInflatedDistribution object from inherited base classes: Distribution with example: obj = ZeroInflatedDistribution(gate, base_dist, validate_args)