from __future__ import absolute_import, division, print_function, unicode_literals

from abc import ABC

from torch.distributions import Distribution
from torch.nn import Module


class Prior(Distribution, Module, ABC):
    """Priors ar imposed on hyperparameters"""

    @property
    def log_transform(self):
        return self._log_transform

    def log_prob(self, parameter):
        """Returns the log-probability of the parameter value under the prior."""
        return super(Prior, self).log_prob(parameter.exp() if self.log_transform else parameter)

@@ -224,44 +224,415 @@
  %22%22%22
-Priors ar imposed on hyperparameters
+%0A    Base class for Priors in GPyTorch.%0A    In GPyTorch, a parameter can be assigned a prior by passing it as the %60prior%60 argument to%0A    :func:%60~gpytorch.module.register_parameter%60. GPyTorch performs internal bookkeeping of priors,%0A    and for each parameter with a registered prior includes the log probability of the parameter under its%0A    respective prior in computing the Marginal Log-Likelihood.%0A    
 %22%22%22%0A

Update docstring for prior