Example for Transformed Distribution (#8011)
diff --git a/torch/distributions/transformed_distribution.py b/torch/distributions/transformed_distribution.py
index 8b8786a..7cc76c5 100644
--- a/torch/distributions/transformed_distribution.py
+++ b/torch/distributions/transformed_distribution.py
@@ -17,6 +17,23 @@
Note that the ``.event_shape`` of a :class:`TransformedDistribution` is the
maximum shape of its base distribution and its transforms, since transforms
can introduce correlations among events.
+
+ An example for the usage of :class:`TransformedDistribution` would be::
+
+ # Building a Logistic Distribution
+ # X ~ Uniform(0, 1)
+ # f = a + b * logit(X)
+ # Y ~ f(X) ~ Logistic(a, b)
+ base_distribution = Uniform(0, 1)
+ transforms = [SigmoidTransform().inv, AffineTransform(loc=a, scale=b)]
+ logistic = TransformedDistribution(base_distribution, transforms)
+
+ For more examples, please look at the implementations of
+ :class:`~torch.distributions.gumbel.Gumbel`,
+ :class:`~torch.distributions.log_normal.LogNormal`,
+ :class:`~torch.distributions.pareto.Pareto`,
+ :class:`~torch.distributions.relaxed_bernoulli.RelaxedBernoulli` and
+ :class:`~torch.distributions.relaxed_categorical.RelaxedOneHotCategorical`
"""
arg_constraints = {}