K = self.kernel(self.X)
S = tf.eye(self.X.shape[0], dtype=self.X.dtype) * self.likelihood.variance
L = tf.linalg.cholesky(K + S)
m = self.mean_function(self.X)
logpdf = multivariate_normal(self.Y, m, L) // (R,) log-likelihoods for each independent dimension of Y
After Change
k_diag = tf.linalg.diag_part(K)
s_diag = tf.fill([num_data], self.likelihood.variance)
ks = tf.linalg.set_diag(K, k_diag + s_diag)
L = tf.linalg.cholesky(ks)
m = self.mean_function(x)
// [R,] log-likelihoods for each independent dimension of Y
distr = tfp.distributions.MultivariateNormalTriL(loc=m, scale_tril=L)