// Add log probs of priors on the parameters
for _, prior, params_and_tfs, prior_tf in self.named_priors():
params = [p if ptf is None else ptf(p) for p, ptf in params_and_tfs]
lp_arg = params[0] if prior_tf is None else prior_tf(*params)
res.add_(prior.log_prob(lp_arg).sum())
// Scale by the amount of data we have
After Change
// Add log probs of priors on the (functions of) parameters
for _, prior, closure in self.named_priors():
res.add_(prior.log_prob(closure()).sum())
// Scale by the amount of data we have
num_data = target.size(-1)