class_docstr: Degenerate discrete distribution (a single point).
  
  Discrete distribution that assigns probability one to the single element in
  its support. Delta distribution parameterized by a random choice should not
  be used with MCMC based inference, as doing so produces incorrect results.
  
  :param torch.Tensor v: The single support element.
  :param torch.Tensor log_density: An optional density for this Delta. This
      is useful to keep the class of :class:`Delta` distributions closed
      under differentiable transformation.
  :param int event_dim: Optional event dimension, defaults to zero.
code: def __init__(
      self, v, log_density=0.0, event_dim=0, validate_args=None
  ):
      if event_dim > v.dim():
          raise ValueError(
              "Expected event_dim <= v.dim(), actual {} vs {}".format(
                  event_dim, v.dim()
              )
          )
      batch_dim = v.dim() - event_dim
      batch_shape = v.shape[:batch_dim]
      event_shape = v.shape[batch_dim:]
      if isinstance(log_density, numbers.Number):
          log_density = torch.full(
              batch_shape, log_density, dtype=v.dtype, device=v.device
          )
      elif validate_args and log_density.shape != batch_shape:
          raise ValueError(
              "Expected log_density.shape = {}, actual {}".format(
                  log_density.shape, batch_shape
              )
          )
      self.v = v
      self.log_density = log_density
      super().__init__(
          batch_shape, event_shape, validate_args=validate_args
      )
  
file_path: pyro/pyro/distributions/delta.py
imports: import numbers
  import torch
  from pyro.distributions.torch_distribution import TorchDistribution
  from pyro.distributions.util import sum_rightmost
  from .None import constraints
label_desc: Use image node_id 1 to create a new Delta object from inherited base classes: TorchDistribution with example: obj = Delta(v, log_density, event_dim, validate_args)