class_docstr: A masked deterministic mixture of two distributions.
  
  This is useful when the mask is sampled from another distribution,
  possibly correlated across the batch. Often the mask can be
  marginalized out via enumeration.
  
  Example::
  
      change_point = pyro.sample("change_point",
                                 dist.Categorical(torch.ones(len(data) + 1)),
                                 infer={'enumerate': 'parallel'})
      mask = torch.arange(len(data), dtype=torch.long) >= changepoint
      with pyro.plate("data", len(data)):
          pyro.sample("obs", MaskedMixture(mask, dist1, dist2), obs=data)
  
  :param torch.Tensor mask: A boolean tensor toggling between ``component0``
      and ``component1``.
  :param pyro.distributions.TorchDistribution component0: a distribution
      for batch elements ``mask == False``.
  :param pyro.distributions.TorchDistribution component1: a distribution
      for batch elements ``mask == True``.
class_docstr_tok: ["A","masked","deterministic","mixture","of","two","distributions",".","This","is","useful","when","the","mask","is","sampled","from","another","distribution",",","possibly","correlated","across","the","batch",".","Often","the","mask","can","be","marginalized","out","via","enumeration",".","Example",":",":","change_point","=","pyro.sample","(","``","change_point","''",",","dist.Categorical","(","torch.ones","(","len","(","data",")","+","1",")",")",",","infer=","{","'enumerate","'",":","'parallel","'","}",")","mask","=","torch.arange","(","len","(","data",")",",","dtype=torch.long",")",">","=","changepoint","with","pyro.plate","(","``","data","''",",","len","(","data",")",")",":","pyro.sample","(","``","obs","''",",","MaskedMixture","(","mask",",","dist1",",","dist2",")",",","obs=data",")",":","param","torch.Tensor","mask",":","A","boolean","tensor","toggling","between","``","component0","``","and","``","component1","``",".",":","param","pyro.distributions.TorchDistribution","component0",":","a","distribution","for","batch","elements","``","mask","==","False","``",".",":","param","pyro.distributions.TorchDistribution","component1",":","a","distribution","for","batch","elements","``","mask","==","True","``","."]
code: def support(self):
      if self.component0.support is self.component1.support:
          return self.component0.support
      return MaskedConstraint(
          self.mask, self.component0.support, self.component1.support
      )
  
file_path: pyro/pyro/distributions/mixture.py
imports: import torch
  from torch.distributions import constraints
  from torch.distributions.utils import lazy_property
  from pyro.distributions.torch_distribution import TorchDistribution
  from pyro.distributions.util import broadcast_shape
label_desc: Use image node_id 3 for calling the MaskedMixture obj's underlying member method code with example usage: obj.support() and returns: MaskedConstraint, self