class_docstr: Masks a distribution by a boolean tensor that is broadcastable to the
  distribution's :attr:`~torch.distributions.distribution.Distribution.batch_shape`.
  
  In the special case ``mask is False``, computation of :meth:`log_prob` ,
  :meth:`score_parts` , and ``kl_divergence()`` is skipped, and constant zero
  values are returned instead.
  
  :param mask: A boolean or boolean-valued tensor.
  :type mask: torch.Tensor or bool
class_docstr_tok: ["Masks","a","distribution","by","a","boolean","tensor","that","is","broadcastable","to","the","distribution","'s",":","attr",":","`","~torch.distributions.distribution.Distribution.batch_shape","`",".","In","the","special","case","``","mask","is","False","``",",","computation","of",":","meth",":","`","log_prob","`",",",":","meth",":","`","score_parts","`",",","and","``","kl_divergence","(",")","``","is","skipped",",","and","constant","zero","values","are","returned","instead",".",":","param","mask",":","A","boolean","or","boolean-valued","tensor",".",":","type","mask",":","torch.Tensor","or","bool"]
code: def log_prob(self, value):
      if self._mask is False:
          shape = broadcast_shape(
              self.base_dist.batch_shape,
              value.shape[: value.dim() - self.event_dim],
          )
          return torch.zeros((), device=value.device).expand(shape)
      if self._mask is True:
          return self.base_dist.log_prob(value)
      return scale_and_mask(
          self.base_dist.log_prob(value), mask=self._mask
      )
  
imports: import warnings
  from collections import OrderedDict
  from typing import Callable
  import torch
  from torch.distributions.kl import kl_divergence, register_kl
  import pyro.distributions.torch
  from .None import constraints
  from .distribution import Distribution
  from .score_parts import ScoreParts
  from .util import broadcast_shape, scale_and_mask
label_desc: Use image node_id 8 for calling the MaskedDistribution obj's underlying member method code with example usage: obj.log_prob(value) and returns: scale_and_mask, torch, self