code: def KL(self, other):
          
          return .5*(
              np.sum(self.variance/other.variance)
              + ((other.mean-self.mean)**2/other.variance).sum()
              - self.num_data * self.input_dim
              + np.sum(np.log(other.variance)) - np.sum(np.log(self.variance))
              )
docs: Compute the KL divergence to another NormalPosterior Object. This only holds, if the two NormalPosterior objects have the same shape, as we do computational tricks for the multivariate normal KL divergence.