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 sample(self, sample_shape=torch.Size()):
      return self.log_factor.new_empty(sample_shape + self.shape())
  
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 3 for calling the Unit obj's underlying member method code with example usage: obj.sample(sample_shape) and returns: self