# Buggy code
def __init__(
    self,
    num_tasks,
    rank=0,
    task_prior=None,
    batch_size=1,
    noise_prior=None,
    param_transform=softplus,
    inv_param_transform=None,
    **kwargs,
):
    """
    Args:
        num_tasks (int): Number of tasks.

        rank (int): The rank of the task noise covariance matrix to fit. If `rank` is set to 0,
        then a diagonal covariance matrix is fit.

        task_prior (:obj:`gpytorch.priors.Prior`): Prior to use over the task noise covariance matrix if
        `rank` > 0, or a prior over the log of just the diagonal elements, if `rank` == 0.

    """
    noise_prior = _deprecate_kwarg(
        kwargs, "log_noise_prior", "noise_prior", noise_prior
    )
    super(Likelihood, self).__init__()
    self._param_transform = param_transform
    self._inv_param_transform = _get_inv_param_transform(
        param_transform, inv_param_transform
    )
    self.register_parameter(
        name="raw_noise", parameter=torch.nn.Parameter(torch.zeros(batch_size, 1))
    )
    if rank == 0:
        self.register_parameter(
            name="raw_task_noises",
            parameter=torch.nn.Parameter(torch.zeros(batch_size, num_tasks)),
        )
        if task_prior is not None:
            raise RuntimeError("Cannot set a `task_prior` if rank=0")
    else:
        self.register_parameter(
            name="task_noise_covar_factor",
            parameter=torch.nn.Parameter(torch.randn(batch_size, num_tasks, rank)),
        )
        if task_prior is not None:
            self.register_prior(
                "MultitaskErrorCovariancePrior", task_prior, self._eval_covar_matrix
            )
    self.num_tasks = num_tasks
    self.rank = rank


# Traceback (TypeError)
import gpytorch
gl = gpytorch.likelihoods.GaussianLikelihood()
gl.initialize(noise=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../gpytorch/gpytorch/module.py", line 89, in initialize
setattr(self, name, val)
File "../lib/python3.6/site-packages/torch/nn/modules/module.py", line 579, in __setattr__
object.__setattr__(self, name, value)
File ".../gpytorch/gpytorch/likelihoods/gaussian_likelihood.py", line 63, in noise
self.noise_covar.initialize(value)
TypeError: initialize() takes 1 positional argument but 2 were given

# Fixed code
def __init__(
    self,
    num_tasks,
    rank=0,
    task_prior=None,
    batch_size=1,
    noise_prior=None,
    param_transform=softplus,
    inv_param_transform=None,
    **kwargs,
):
    """
    Args:
        num_tasks (int): Number of tasks.

        rank (int): The rank of the task noise covariance matrix to fit. If `rank` is set to 0,
        then a diagonal covariance matrix is fit.

        task_prior (:obj:`gpytorch.priors.Prior`): Prior to use over the task noise covariance matrix if
        `rank` > 0, or a prior over the log of just the diagonal elements, if `rank` == 0.

    """
    super(Likelihood, self).__init__()
    self._param_transform = param_transform
    self._inv_param_transform = _get_inv_param_transform(
        param_transform, inv_param_transform
    )
    self.register_parameter(
        name="raw_noise", parameter=torch.nn.Parameter(torch.zeros(batch_size, 1))
    )
    if rank == 0:
        self.register_parameter(
            name="raw_task_noises",
            parameter=torch.nn.Parameter(torch.zeros(batch_size, num_tasks)),
        )
        if task_prior is not None:
            raise RuntimeError("Cannot set a `task_prior` if rank=0")
    else:
        self.register_parameter(
            name="task_noise_covar_factor",
            parameter=torch.nn.Parameter(torch.randn(batch_size, num_tasks, rank)),
        )
        if task_prior is not None:
            self.register_prior(
                "MultitaskErrorCovariancePrior", task_prior, self._eval_covar_matrix
            )
    self.num_tasks = num_tasks
    self.rank = rank