def METHOD_NAME(self, sample_shape=torch.Size()):
    shape = self._extended_shape(sample_shape)
    with torch.no_grad():
        mask = torch.bernoulli(self.gate.expand(shape)).bool()
        samples = self.base_dist.expand(shape).METHOD_NAME()
        samples = torch.where(mask, samples.new_zeros(()), samples)
    return samples