docstr: Parameters
  ----------
  covariance
      The covariance matrix of the GP of shape
      (batch_size, prediction_length, prediction_length).
  mean
      The mean vector of the GP of shape (batch_size, prediction_length).
  Returns
  -------
  Tensor
      Samples from a Gaussian Process of shape
      (batch_size, prediction_length, num_samples), where :math:`L` is
      the matrix square root, Cholesky Factor of the covariance matrix
      with the added noise tolerance on the diagonal, :math:`Lz`,
      where :math:`z \sim N(0,I)` and assumes the mean is zero.
docstr_tok: ["Parameters","--","--","--","--","--","covariance","The","covariance","matrix","of","the","GP","of","shape","(","batch_size",",","prediction_length",",","prediction_length",")",".","mean","The","mean","vector","of","the","GP","of","shape","(","batch_size",",","prediction_length",")",".","Returns","--","--","--","-","Tensor","Samples","from","a","Gaussian","Process","of","shape","(","batch_size",",","prediction_length",",","num_samples",")",",","where",":","math",":","`","L","`","is","the","matrix","square","root",",","Cholesky","Factor","of","the","covariance","matrix","with","the","added","noise","tolerance","on","the","diagonal",",",":","math",":","`","Lz","`",",","where",":","math",":","`","z","\\sim","N","(","0",",","I",")","`","and","assumes","the","mean","is","zero","."]
code: def sample(self, mean: Tensor, covariance: Tensor) -> Tensor:
      r"""
      Parameters
      ----------
      covariance
          The covariance matrix of the GP of shape
          (batch_size, prediction_length, prediction_length).
      mean
          The mean vector of the GP of shape (batch_size, prediction_length).
      Returns
      -------
      Tensor
          Samples from a Gaussian Process of shape
          (batch_size, prediction_length, num_samples), where :math:`L` is
          the matrix square root, Cholesky Factor of the covariance matrix
          with the added noise tolerance on the diagonal, :math:`Lz`,
          where :math:`z \sim N(0,I)` and assumes the mean is zero.
      """
      assert (
          self.num_samples is not None
      ), "The value of `num_samples` must be set."
      assert (
          self.prediction_length is not None
      ), "The value of `prediction_length` must be set."
      samples = MultivariateGaussian(
          mean,
          self._compute_cholesky_gp(
              covariance, self.prediction_length, self.sample_noise
          ),
      ).sample_rep(
          self.num_samples, dtype=self.float_type
      )  # Shape (num_samples, batch_size, prediction_length)
      return self.F.transpose(samples, axes=(1, 2, 0))
  
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 4 for calling the GaussianProcess obj's underlying member method code with example usage: obj.sample(mean, covariance) and returns: self