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 expand(self, batch_shape, _instance=None):
      batch_shape = torch.Size(batch_shape)
      new = self._get_checked_instance(Unit, _instance)
      new.log_factor = self.log_factor.expand(batch_shape)
      if "has_rsample" in self.__dict__:
          new.has_rsample = self.has_rsample
      super(Unit, new).__init__(
          batch_shape, self.event_shape, validate_args=False
      )
      new._validate_args = self._validate_args
      return new
  
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 2 for calling the Unit obj's underlying member method code with example usage: obj.expand(batch_shape, _instance) and returns: new