class_docstr: Trivial nonnormalized distribution representing the unit type.
  
  The unit type has a single value with no data, i.e. ``value.numel() == 0``.
  
  This is used for :func:`pyro.factor` statements.
class_docstr_tok: ["Trivial","nonnormalized","distribution","representing","the","unit","type",".","The","unit","type","has","a","single","value","with","no","data",",","i.e",".","``","value.numel","(",")","==","0","``",".","This","is","used","for",":","func",":","`","pyro.factor","`","statements","."]
code: def __init__(
      self, log_factor, *, has_rsample=None, validate_args=None
  ):
      log_factor = torch.as_tensor(log_factor)
      batch_shape = log_factor.shape
      event_shape = torch.Size((0,))  # This satisfies .numel() == 0.
      self.log_factor = log_factor
      if has_rsample is not None:
          self.has_rsample = has_rsample
      super().__init__(
          batch_shape, event_shape, validate_args=validate_args
      )
  
file_path: pyro/pyro/distributions/unit.py
imports: import torch
  from torch.distributions import constraints
  from pyro.distributions.torch_distribution import TorchDistribution
  from pyro.distributions.util import broadcast_shape
label_desc: Use image node_id 1 to create a new Unit object from inherited base classes: TorchDistribution with example: obj = Unit(log_factor)