We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
MaskedMixture distribution doesn't work properly when Delta distribution is used as a component
### Issue Description
MaskedMixture fails when Delta distribution is used as a component distribution. In particular, sampling from MaskedMixture outputs wrong values and also alters the Delta distribution used as a component.

### Code Snippet
```py
import sys
import torch
import pyro
import pyro.distributions as dist

print(sys.version)
print(pyro.__version__)
print(torch.__version__)

delta = dist.Delta(torch.tensor([0.]))
gamma = dist.Gamma(torch.ones(2)*100., torch.ones(1))
m = torch.tensor([0, 1]).bool()

print("\nDelta dist before sampling:", delta)

masked_mixture = dist.MaskedMixture(m, delta, gamma)
print("\nSample masked mixture:", masked_mixture.sample())

print("\nDelta dist after sampling:", delta)
```
returns:
```
3.7.6 (default, Jan  8 2020, 19:59:22)
[GCC 7.3.0]
1.2.0
1.4.0

Delta dist before sampling: Delta(v: tensor([0.]), log_density: tensor([0.]))

Sample masked mixture: tensor([103.3137, 103.3137])

Delta dist after sampling: Delta(v: tensor([103.3137]), log_density: tensor([0.]))
```
possible solution (at least it fixes the example above) is to use torch.where in pyro/distributions/mixture.py file like below:

```diff
  def sample(self, sample_shape=torch.Size()):
      mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
-     result = self.component0.sample(sample_shape)
-     result[mask] = self.component1.sample(sample_shape)[mask]
+     result = torch.where(mask,
+                          self.component1.sample(sample_shape),
+                          self.component0.sample(sample_shape))
      return result
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pyro/distributions/mixture.py`
Content:
```
1 # Copyright (c) 2017-2019 Uber Technologies, Inc.
2 # SPDX-License-Identifier: Apache-2.0
3 
4 import torch
5 from torch.distributions import constraints
6 from torch.distributions.utils import lazy_property
7 
8 from pyro.distributions.torch_distribution import TorchDistribution
9 from pyro.distributions.util import broadcast_shape
10 
11 
12 class MaskedConstraint(constraints.Constraint):
13     """
14     Combines two constraints interleaved elementwise by a mask.
15 
16     :param torch.Tensor mask: boolean mask tensor (of dtype ``torch.bool``)
17     :param torch.constraints.Constraint constraint0: constraint that holds
18         wherever ``mask == 0``
19     :param torch.constraints.Constraint constraint1: constraint that holds
20         wherever ``mask == 1``
21     """
22     def __init__(self, mask, constraint0, constraint1):
23         self.mask = mask
24         self.constraint0 = constraint0
25         self.constraint1 = constraint1
26 
27     def check(self, value):
28         result = self.constraint0.check(value)
29         mask = self.mask.expand(result.shape) if result.shape != self.mask.shape else self.mask
30         result[mask] = self.constraint1.check(value)[mask]
31         return result
32 
33 
34 class MaskedMixture(TorchDistribution):
35     """
36     A masked deterministic mixture of two distributions.
37 
38     This is useful when the mask is sampled from another distribution,
39     possibly correlated across the batch. Often the mask can be
40     marginalized out via enumeration.
41 
42     Example::
43 
44         change_point = pyro.sample("change_point",
45                                    dist.Categorical(torch.ones(len(data) + 1)),
46                                    infer={'enumerate': 'parallel'})
47         mask = torch.arange(len(data), dtype=torch.long) >= changepoint
48         with pyro.plate("data", len(data)):
49             pyro.sample("obs", MaskedMixture(mask, dist1, dist2), obs=data)
50 
51     :param torch.Tensor mask: A byte tensor toggling between ``component0``
52         and ``component1``.
53     :param pyro.distributions.TorchDistribution component0: a distribution
54         for batch elements ``mask == 0``.
55     :param pyro.distributions.TorchDistribution component1: a distribution
56         for batch elements ``mask == 1``.
57     """
58     arg_constraints = {}  # nothing can be constrained
59 
60     def __init__(self, mask, component0, component1, validate_args=None):
61         if not torch.is_tensor(mask) or mask.dtype != torch.bool:
62             raise ValueError('Expected mask to be a BoolTensor but got {}'.format(type(mask)))
63         if component0.event_shape != component1.event_shape:
64             raise ValueError('components event_shape disagree: {} vs {}'
65                              .format(component0.event_shape, component1.event_shape))
66         batch_shape = broadcast_shape(mask.shape, component0.batch_shape, component1.batch_shape)
67         if mask.shape != batch_shape:
68             mask = mask.expand(batch_shape)
69         if component0.batch_shape != batch_shape:
70             component0 = component0.expand(batch_shape)
71         if component1.batch_shape != batch_shape:
72             component1 = component1.expand(batch_shape)
73 
74         self.mask = mask
75         self.component0 = component0
76         self.component1 = component1
77         super(MaskedMixture, self).__init__(batch_shape, component0.event_shape, validate_args)
78 
79         # We need to disable _validate_sample on each component since samples are only valid on the
80         # component from which they are drawn. Instead we perform validation using a MaskedConstraint.
81         self.component0._validate_args = False
82         self.component1._validate_args = False
83 
84     @property
85     def has_rsample(self):
86         return self.component0.has_rsample and self.component1.has_rsample
87 
88     @constraints.dependent_property
89     def support(self):
90         if self.component0.support is self.component1.support:
91             return self.component0.support
92         return MaskedConstraint(self.mask, self.component0.support, self.component1.support)
93 
94     def expand(self, batch_shape):
95         try:
96             return super(MaskedMixture, self).expand(batch_shape)
97         except NotImplementedError:
98             mask = self.mask.expand(batch_shape)
99             component0 = self.component0.expand(batch_shape)
100             component1 = self.component1.expand(batch_shape)
101             return type(self)(mask, component0, component1)
102 
103     def sample(self, sample_shape=torch.Size()):
104         mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
105         result = self.component0.sample(sample_shape)
106         result[mask] = self.component1.sample(sample_shape)[mask]
107         return result
108 
109     def rsample(self, sample_shape=torch.Size()):
110         mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
111         result = self.component0.rsample(sample_shape)
112         result[mask] = self.component1.rsample(sample_shape)[mask]
113         return result
114 
115     def log_prob(self, value):
116         value_shape = broadcast_shape(value.shape, self.batch_shape + self.event_shape)
117         if value.shape != value_shape:
118             value = value.expand(value_shape)
119         if self._validate_args:
120             self._validate_sample(value)
121         mask_shape = value_shape[:len(value_shape) - len(self.event_shape)]
122         mask = self.mask
123         if mask.shape != mask_shape:
124             mask = mask.expand(mask_shape)
125         result = self.component0.log_prob(value)
126         result[mask] = self.component1.log_prob(value)[mask]
127         return result
128 
129     @lazy_property
130     def mean(self):
131         result = self.component0.mean.clone()
132         result[self.mask] = self.component1.mean[self.mask]
133         return result
134 
135     @lazy_property
136     def variance(self):
137         result = self.component0.variance.clone()
138         result[self.mask] = self.component1.variance[self.mask]
139         return result
140
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pyro/distributions/mixture.py b/pyro/distributions/mixture.py
--- a/pyro/distributions/mixture.py
+++ b/pyro/distributions/mixture.py
@@ -101,15 +101,19 @@
             return type(self)(mask, component0, component1)
 
     def sample(self, sample_shape=torch.Size()):
-        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
-        result = self.component0.sample(sample_shape)
-        result[mask] = self.component1.sample(sample_shape)[mask]
+        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)
+        mask = mask.expand(sample_shape + self.shape())
+        result = torch.where(mask,
+                             self.component1.sample(sample_shape),
+                             self.component0.sample(sample_shape))
         return result
 
     def rsample(self, sample_shape=torch.Size()):
-        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
-        result = self.component0.rsample(sample_shape)
-        result[mask] = self.component1.rsample(sample_shape)[mask]
+        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)
+        mask = mask.expand(sample_shape + self.shape())
+        result = torch.where(mask,
+                             self.component1.rsample(sample_shape),
+                             self.component0.rsample(sample_shape))
         return result
 
     def log_prob(self, value):
@@ -122,8 +126,9 @@
         mask = self.mask
         if mask.shape != mask_shape:
             mask = mask.expand(mask_shape)
-        result = self.component0.log_prob(value)
-        result[mask] = self.component1.log_prob(value)[mask]
+        result = torch.where(mask,
+                             self.component1.log_prob(value),
+                             self.component0.log_prob(value))
         return result
 
     @lazy_property

{"golden_diff": "diff --git a/pyro/distributions/mixture.py b/pyro/distributions/mixture.py\n--- a/pyro/distributions/mixture.py\n+++ b/pyro/distributions/mixture.py\n@@ -101,15 +101,19 @@\n             return type(self)(mask, component0, component1)\n \n     def sample(self, sample_shape=torch.Size()):\n-        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask\n-        result = self.component0.sample(sample_shape)\n-        result[mask] = self.component1.sample(sample_shape)[mask]\n+        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)\n+        mask = mask.expand(sample_shape + self.shape())\n+        result = torch.where(mask,\n+                             self.component1.sample(sample_shape),\n+                             self.component0.sample(sample_shape))\n         return result\n \n     def rsample(self, sample_shape=torch.Size()):\n-        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask\n-        result = self.component0.rsample(sample_shape)\n-        result[mask] = self.component1.rsample(sample_shape)[mask]\n+        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)\n+        mask = mask.expand(sample_shape + self.shape())\n+        result = torch.where(mask,\n+                             self.component1.rsample(sample_shape),\n+                             self.component0.rsample(sample_shape))\n         return result\n \n     def log_prob(self, value):\n@@ -122,8 +126,9 @@\n         mask = self.mask\n         if mask.shape != mask_shape:\n             mask = mask.expand(mask_shape)\n-        result = self.component0.log_prob(value)\n-        result[mask] = self.component1.log_prob(value)[mask]\n+        result = torch.where(mask,\n+                             self.component1.log_prob(value),\n+                             self.component0.log_prob(value))\n         return result\n \n     @lazy_property\n", "issue": "MaskedMixture distribution doesn't work properly when Delta distribution is used as a component\n### Issue Description\r\nMaskedMixture fails when Delta distribution is used as a component distribution. In particular, sampling from MaskedMixture outputs wrong values and also alters the Delta distribution used as a component.\r\n\r\n### Code Snippet\r\n```py\r\nimport sys\r\nimport torch\r\nimport pyro\r\nimport pyro.distributions as dist\r\n\r\nprint(sys.version)\r\nprint(pyro.__version__)\r\nprint(torch.__version__)\r\n\r\ndelta = dist.Delta(torch.tensor([0.]))\r\ngamma = dist.Gamma(torch.ones(2)*100., torch.ones(1))\r\nm = torch.tensor([0, 1]).bool()\r\n\r\nprint(\"\\nDelta dist before sampling:\", delta)\r\n\r\nmasked_mixture = dist.MaskedMixture(m, delta, gamma)\r\nprint(\"\\nSample masked mixture:\", masked_mixture.sample())\r\n\r\nprint(\"\\nDelta dist after sampling:\", delta)\r\n```\r\nreturns:\r\n```\r\n3.7.6 (default, Jan  8 2020, 19:59:22)\r\n[GCC 7.3.0]\r\n1.2.0\r\n1.4.0\r\n\r\nDelta dist before sampling: Delta(v: tensor([0.]), log_density: tensor([0.]))\r\n\r\nSample masked mixture: tensor([103.3137, 103.3137])\r\n\r\nDelta dist after sampling: Delta(v: tensor([103.3137]), log_density: tensor([0.]))\r\n```\r\npossible solution (at least it fixes the example above) is to use torch.where in pyro/distributions/mixture.py file like below:\r\n\r\n```diff\r\n  def sample(self, sample_shape=torch.Size()):\r\n      mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask\r\n-     result = self.component0.sample(sample_shape)\r\n-     result[mask] = self.component1.sample(sample_shape)[mask]\r\n+     result = torch.where(mask,\r\n+                          self.component1.sample(sample_shape),\r\n+                          self.component0.sample(sample_shape))\r\n      return result\r\n```\n", "before_files": [{"content": "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport torch\nfrom torch.distributions import constraints\nfrom torch.distributions.utils import lazy_property\n\nfrom pyro.distributions.torch_distribution import TorchDistribution\nfrom pyro.distributions.util import broadcast_shape\n\n\nclass MaskedConstraint(constraints.Constraint):\n    \"\"\"\n    Combines two constraints interleaved elementwise by a mask.\n\n    :param torch.Tensor mask: boolean mask tensor (of dtype ``torch.bool``)\n    :param torch.constraints.Constraint constraint0: constraint that holds\n        wherever ``mask == 0``\n    :param torch.constraints.Constraint constraint1: constraint that holds\n        wherever ``mask == 1``\n    \"\"\"\n    def __init__(self, mask, constraint0, constraint1):\n        self.mask = mask\n        self.constraint0 = constraint0\n        self.constraint1 = constraint1\n\n    def check(self, value):\n        result = self.constraint0.check(value)\n        mask = self.mask.expand(result.shape) if result.shape != self.mask.shape else self.mask\n        result[mask] = self.constraint1.check(value)[mask]\n        return result\n\n\nclass MaskedMixture(TorchDistribution):\n    \"\"\"\n    A masked deterministic mixture of two distributions.\n\n    This is useful when the mask is sampled from another distribution,\n    possibly correlated across the batch. Often the mask can be\n    marginalized out via enumeration.\n\n    Example::\n\n        change_point = pyro.sample(\"change_point\",\n                                   dist.Categorical(torch.ones(len(data) + 1)),\n                                   infer={'enumerate': 'parallel'})\n        mask = torch.arange(len(data), dtype=torch.long) >= changepoint\n        with pyro.plate(\"data\", len(data)):\n            pyro.sample(\"obs\", MaskedMixture(mask, dist1, dist2), obs=data)\n\n    :param torch.Tensor mask: A byte tensor toggling between ``component0``\n        and ``component1``.\n    :param pyro.distributions.TorchDistribution component0: a distribution\n        for batch elements ``mask == 0``.\n    :param pyro.distributions.TorchDistribution component1: a distribution\n        for batch elements ``mask == 1``.\n    \"\"\"\n    arg_constraints = {}  # nothing can be constrained\n\n    def __init__(self, mask, component0, component1, validate_args=None):\n        if not torch.is_tensor(mask) or mask.dtype != torch.bool:\n            raise ValueError('Expected mask to be a BoolTensor but got {}'.format(type(mask)))\n        if component0.event_shape != component1.event_shape:\n            raise ValueError('components event_shape disagree: {} vs {}'\n                             .format(component0.event_shape, component1.event_shape))\n        batch_shape = broadcast_shape(mask.shape, component0.batch_shape, component1.batch_shape)\n        if mask.shape != batch_shape:\n            mask = mask.expand(batch_shape)\n        if component0.batch_shape != batch_shape:\n            component0 = component0.expand(batch_shape)\n        if component1.batch_shape != batch_shape:\n            component1 = component1.expand(batch_shape)\n\n        self.mask = mask\n        self.component0 = component0\n        self.component1 = component1\n        super(MaskedMixture, self).__init__(batch_shape, component0.event_shape, validate_args)\n\n        # We need to disable _validate_sample on each component since samples are only valid on the\n        # component from which they are drawn. Instead we perform validation using a MaskedConstraint.\n        self.component0._validate_args = False\n        self.component1._validate_args = False\n\n    @property\n    def has_rsample(self):\n        return self.component0.has_rsample and self.component1.has_rsample\n\n    @constraints.dependent_property\n    def support(self):\n        if self.component0.support is self.component1.support:\n            return self.component0.support\n        return MaskedConstraint(self.mask, self.component0.support, self.component1.support)\n\n    def expand(self, batch_shape):\n        try:\n            return super(MaskedMixture, self).expand(batch_shape)\n        except NotImplementedError:\n            mask = self.mask.expand(batch_shape)\n            component0 = self.component0.expand(batch_shape)\n            component1 = self.component1.expand(batch_shape)\n            return type(self)(mask, component0, component1)\n\n    def sample(self, sample_shape=torch.Size()):\n        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask\n        result = self.component0.sample(sample_shape)\n        result[mask] = self.component1.sample(sample_shape)[mask]\n        return result\n\n    def rsample(self, sample_shape=torch.Size()):\n        mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask\n        result = self.component0.rsample(sample_shape)\n        result[mask] = self.component1.rsample(sample_shape)[mask]\n        return result\n\n    def log_prob(self, value):\n        value_shape = broadcast_shape(value.shape, self.batch_shape + self.event_shape)\n        if value.shape != value_shape:\n            value = value.expand(value_shape)\n        if self._validate_args:\n            self._validate_sample(value)\n        mask_shape = value_shape[:len(value_shape) - len(self.event_shape)]\n        mask = self.mask\n        if mask.shape != mask_shape:\n            mask = mask.expand(mask_shape)\n        result = self.component0.log_prob(value)\n        result[mask] = self.component1.log_prob(value)[mask]\n        return result\n\n    @lazy_property\n    def mean(self):\n        result = self.component0.mean.clone()\n        result[self.mask] = self.component1.mean[self.mask]\n        return result\n\n    @lazy_property\n    def variance(self):\n        result = self.component0.variance.clone()\n        result[self.mask] = self.component1.variance[self.mask]\n        return result\n", "path": "pyro/distributions/mixture.py"}], "after_files": [{"content": "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport torch\nfrom torch.distributions import constraints\nfrom torch.distributions.utils import lazy_property\n\nfrom pyro.distributions.torch_distribution import TorchDistribution\nfrom pyro.distributions.util import broadcast_shape\n\n\nclass MaskedConstraint(constraints.Constraint):\n    \"\"\"\n    Combines two constraints interleaved elementwise by a mask.\n\n    :param torch.Tensor mask: boolean mask tensor (of dtype ``torch.bool``)\n    :param torch.constraints.Constraint constraint0: constraint that holds\n        wherever ``mask == 0``\n    :param torch.constraints.Constraint constraint1: constraint that holds\n        wherever ``mask == 1``\n    \"\"\"\n    def __init__(self, mask, constraint0, constraint1):\n        self.mask = mask\n        self.constraint0 = constraint0\n        self.constraint1 = constraint1\n\n    def check(self, value):\n        result = self.constraint0.check(value)\n        mask = self.mask.expand(result.shape) if result.shape != self.mask.shape else self.mask\n        result[mask] = self.constraint1.check(value)[mask]\n        return result\n\n\nclass MaskedMixture(TorchDistribution):\n    \"\"\"\n    A masked deterministic mixture of two distributions.\n\n    This is useful when the mask is sampled from another distribution,\n    possibly correlated across the batch. Often the mask can be\n    marginalized out via enumeration.\n\n    Example::\n\n        change_point = pyro.sample(\"change_point\",\n                                   dist.Categorical(torch.ones(len(data) + 1)),\n                                   infer={'enumerate': 'parallel'})\n        mask = torch.arange(len(data), dtype=torch.long) >= changepoint\n        with pyro.plate(\"data\", len(data)):\n            pyro.sample(\"obs\", MaskedMixture(mask, dist1, dist2), obs=data)\n\n    :param torch.Tensor mask: A byte tensor toggling between ``component0``\n        and ``component1``.\n    :param pyro.distributions.TorchDistribution component0: a distribution\n        for batch elements ``mask == 0``.\n    :param pyro.distributions.TorchDistribution component1: a distribution\n        for batch elements ``mask == 1``.\n    \"\"\"\n    arg_constraints = {}  # nothing can be constrained\n\n    def __init__(self, mask, component0, component1, validate_args=None):\n        if not torch.is_tensor(mask) or mask.dtype != torch.bool:\n            raise ValueError('Expected mask to be a BoolTensor but got {}'.format(type(mask)))\n        if component0.event_shape != component1.event_shape:\n            raise ValueError('components event_shape disagree: {} vs {}'\n                             .format(component0.event_shape, component1.event_shape))\n        batch_shape = broadcast_shape(mask.shape, component0.batch_shape, component1.batch_shape)\n        if mask.shape != batch_shape:\n            mask = mask.expand(batch_shape)\n        if component0.batch_shape != batch_shape:\n            component0 = component0.expand(batch_shape)\n        if component1.batch_shape != batch_shape:\n            component1 = component1.expand(batch_shape)\n\n        self.mask = mask\n        self.component0 = component0\n        self.component1 = component1\n        super(MaskedMixture, self).__init__(batch_shape, component0.event_shape, validate_args)\n\n        # We need to disable _validate_sample on each component since samples are only valid on the\n        # component from which they are drawn. Instead we perform validation using a MaskedConstraint.\n        self.component0._validate_args = False\n        self.component1._validate_args = False\n\n    @property\n    def has_rsample(self):\n        return self.component0.has_rsample and self.component1.has_rsample\n\n    @constraints.dependent_property\n    def support(self):\n        if self.component0.support is self.component1.support:\n            return self.component0.support\n        return MaskedConstraint(self.mask, self.component0.support, self.component1.support)\n\n    def expand(self, batch_shape):\n        try:\n            return super(MaskedMixture, self).expand(batch_shape)\n        except NotImplementedError:\n            mask = self.mask.expand(batch_shape)\n            component0 = self.component0.expand(batch_shape)\n            component1 = self.component1.expand(batch_shape)\n            return type(self)(mask, component0, component1)\n\n    def sample(self, sample_shape=torch.Size()):\n        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)\n        mask = mask.expand(sample_shape + self.shape())\n        result = torch.where(mask,\n                             self.component1.sample(sample_shape),\n                             self.component0.sample(sample_shape))\n        return result\n\n    def rsample(self, sample_shape=torch.Size()):\n        mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)\n        mask = mask.expand(sample_shape + self.shape())\n        result = torch.where(mask,\n                             self.component1.rsample(sample_shape),\n                             self.component0.rsample(sample_shape))\n        return result\n\n    def log_prob(self, value):\n        value_shape = broadcast_shape(value.shape, self.batch_shape + self.event_shape)\n        if value.shape != value_shape:\n            value = value.expand(value_shape)\n        if self._validate_args:\n            self._validate_sample(value)\n        mask_shape = value_shape[:len(value_shape) - len(self.event_shape)]\n        mask = self.mask\n        if mask.shape != mask_shape:\n            mask = mask.expand(mask_shape)\n        result = torch.where(mask,\n                             self.component1.log_prob(value),\n                             self.component0.log_prob(value))\n        return result\n\n    @lazy_property\n    def mean(self):\n        result = self.component0.mean.clone()\n        result[self.mask] = self.component1.mean[self.mask]\n        return result\n\n    @lazy_property\n    def variance(self):\n        result = self.component0.variance.clone()\n        result[self.mask] = self.component1.variance[self.mask]\n        return result\n", "path": "pyro/distributions/mixture.py"}]}