code: def test_jitter_synthetic_gp(jitter_method, float_type, ctx) -> None:
      # TODO: Enable GPU tests on Jenkins
      if ctx == "gpu" and not check_gpu_support():
          return
      # Initialize problem parameters
      batch_size = 1
      prediction_length = 50
      context_length = 5
      num_samples = 3
  
      with mx.Context(ctx):
          # Initialize test data to generate Gaussian Process from
          lb = -5
          ub = 5
          dx = (ub - lb) / (prediction_length - 1)
          x_test = nd.arange(lb, ub + dx, dx, dtype=float_type).reshape(
              -1, 1
          )
          x_test = nd.tile(x_test, reps=(batch_size, 1, 1))
  
          # Define the GP hyper parameters
          amplitude = nd.ones((batch_size, 1, 1), dtype=float_type)
          length_scale = math.sqrt(0.4) * nd.ones_like(amplitude)
          sigma = math.sqrt(1e-5) * nd.ones_like(amplitude)
  
          # Instantiate desired kernel object and compute kernel matrix
          rbf_kernel = RBFKernel(amplitude, length_scale)
  
          # Generate samples from 0 mean Gaussian process with RBF Kernel and plot it
          gp = GaussianProcess(
              sigma=sigma,
              kernel=rbf_kernel,
              prediction_length=prediction_length,
              context_length=context_length,
              num_samples=num_samples,
              float_type=float_type,
              jitter_method=jitter_method,
              sample_noise=False,  # Returns sample without noise
          )
  
          # Generate training set on subset of interval using the sine function
          x_train = nd.array(
              [-4, -3, -2, -1, 1], dtype=float_type
          ).reshape(context_length, 1)
          x_train = nd.tile(x_train, reps=(batch_size, 1, 1))
          y_train = nd.sin(x_train.squeeze(axis=2))
  
          # Predict exact GP using the GP predictive mean and covariance using the same fixed hyper-parameters
          samples, predictive_mean, predictive_std = gp.exact_inference(
              x_train, y_train, x_test
          )
  
      assert (
          np.sum(np.isnan(samples.asnumpy())) == 0
      ), "NaNs in predictive samples!"
  
file_path: gluonts/test/mx/test_jitter.py
imports: import math
  import sys
  import mxnet
  import mxnet.ndarray
  import numpy
  import pytest
  from gluonts.mx.model.gp_forecaster.gaussian_process import GaussianProcess
  from gluonts.mx.context import check_gpu_support
  from gluonts.mx.kernels import RBFKernel
  from gluonts.mx.linalg_util import jitter_cholesky, jitter_cholesky_eig
label_desc: Use image node_id 2 for calling a global function with example usage: test_jitter_synthetic_gp(jitter_method, float_type, ctx) without return types