Return `pyro.distributions.TransformedDistribution` instead of `torch.distributions.TransformedDistribution` when conditioning
@@ -6,6 +6,8 @@ from abc import ABC, abstractmethod
import torch
import torch.nn
+from .torch import TransformedDistribution
+
class ConditionalDistribution(ABC):
@abstractmethod
@@ -63,4 +65,4 @@ class ConditionalTransformedDistribution(ConditionalDistribution):
def condition(self, context):
base_dist = self.base_dist.condition(context)
transforms = [t.condition(context) for t in self.transforms]
- return torch.distributions.TransformedDistribution(base_dist, transforms)
+ return TransformedDistribution(base_dist, transforms)
