docstr: Parameters
  ----------
  x_train
      Training set of features of shape
      (batch_size, context_length, num_features).
  y_train
      Training labels of shape (batch_size, context_length).
  x_test
      Test set of features of shape
      (batch_size, prediction_length, num_features).
  Returns
  -------
  Tuple
      Tensor
          Predictive GP samples of shape
          (batch_size, prediction_length, num_samples).
      Tensor
          Predictive mean of the GP of shape
          (batch_size, prediction_length).
      Tensor
          Predictive standard deviation of the GP of shape
          (batch_size, prediction_length).
docstr_tok: ["Parameters","--","--","--","--","--","x_train","Training","set","of","features","of","shape","(","batch_size",",","context_length",",","num_features",")",".","y_train","Training","labels","of","shape","(","batch_size",",","context_length",")",".","x_test","Test","set","of","features","of","shape","(","batch_size",",","prediction_length",",","num_features",")",".","Returns","--","--","--","-","Tuple","Tensor","Predictive","GP","samples","of","shape","(","batch_size",",","prediction_length",",","num_samples",")",".","Tensor","Predictive","mean","of","the","GP","of","shape","(","batch_size",",","prediction_length",")",".","Tensor","Predictive","standard","deviation","of","the","GP","of","shape","(","batch_size",",","prediction_length",")","."]
code: def exact_inference(
      self, x_train: Tensor, y_train: Tensor, x_test: Tensor
  ) -> Tuple[Tensor, Tensor, Tensor]:
      """
      Parameters
      ----------
      x_train
          Training set of features of shape
          (batch_size, context_length, num_features).
      y_train
          Training labels of shape (batch_size, context_length).
      x_test
          Test set of features of shape
          (batch_size, prediction_length, num_features).
      Returns
      -------
      Tuple
          Tensor
              Predictive GP samples of shape
              (batch_size, prediction_length, num_samples).
          Tensor
              Predictive mean of the GP of shape
              (batch_size, prediction_length).
          Tensor
              Predictive standard deviation of the GP of shape
              (batch_size, prediction_length).
      """
      assert (
          self.context_length is not None
      ), "The value of `context_length` must be set."
      assert (
          self.prediction_length is not None
      ), "The value of `prediction_length` must be set."
      # Compute Cholesky factorization of training kernel matrix
      l_train = self._compute_cholesky_gp(
          self.kernel.kernel_matrix(x_train, x_train),
          self.context_length,
      )
  
      lower_tri_solve = self.F.linalg.trsm(
          l_train, self.kernel.kernel_matrix(x_train, x_test)
      )
      predictive_mean = self.F.linalg.gemm2(
          lower_tri_solve,
          self.F.linalg.trsm(l_train, y_train.expand_dims(axis=-1)),
          transpose_a=True,
      ).squeeze(axis=-1)
      # Can rewrite second term as
      # :math:`||L^-1 * K(x_train,x_test||_2^2`
      #  and only solve 1 equation
      predictive_covariance = self.kernel.kernel_matrix(
          x_test, x_test
      ) - self.F.linalg.gemm2(
          lower_tri_solve, lower_tri_solve, transpose_a=True
      )
      # Extract diagonal entries of covariance matrix
      predictive_std = batch_diagonal(
          self.F,
          predictive_covariance,
          self.prediction_length,
          self.float_type,
      )
      # If self.sample_noise = True, predictive covariance has sigma^2 on the
      # diagonal
      if self.sample_noise:
          predictive_std = self.F.broadcast_add(
              predictive_std, self.sigma**2
          )
      predictive_std = self.F.sqrt(predictive_std).squeeze(axis=-1)
      # Compute sample from GP predictive distribution
      return (
          self.sample(predictive_mean, predictive_covariance),
          predictive_mean,
          predictive_std,
      )
  
file_path: gluonts/src/gluonts/mx/model/gp_forecaster/gaussian_process.py
imports: from typing import Optional, Tuple, Type
  import mxnet
  import numpy
  from gluonts.mx import Tensor
  from gluonts.mx.distribution import MultivariateGaussian
  from gluonts.mx.distribution.distribution import getF
  from gluonts.mx.kernels import Kernel
  from gluonts.mx.linalg_util import batch_diagonal, jitter_cholesky, jitter_cholesky_eig
label_desc: Use image node_id 5 for calling the GaussianProcess obj's underlying member method code with example usage: obj.exact_inference(x_train, y_train, x_test) and returns: self,  predictive_mean,  predictive_std