code: def _get_single_task_gpytorch_model(
      Xs: List[Tensor],
      Ys: List[Tensor],
      Yvars: List[Tensor],
      task_features: List[int],
      fidelity_features: List[int],
      state_dict: Optional[Dict[str, Tensor]] = None,
      num_samples: int = 512,
      thinning: int = 16,
      use_input_warping: bool = False,
      gp_kernel: str = "matern",
      **kwargs: Any,
  ) -> ModelListGP:
      r"""Instantiates a batched GPyTorchModel(ModelListGP) based on the given data.
      The model fitting is based on MCMC and is run separately using pyro. The MCMC
      samples will be loaded into the model instantiated here afterwards.
  
      Returns:
          A ModelListGP.
      """
      if len(task_features) > 0:
          raise NotImplementedError(
              "Currently do not support MT-GP models with MCMC!"
          )
      if len(fidelity_features) > 0:
          raise NotImplementedError(
              "Fidelity MF-GP models are not currently supported with MCMC!"
          )
  
      num_mcmc_samples = num_samples // thinning
      covar_modules = [
          _get_rbf_kernel(
              num_samples=num_mcmc_samples, dim=Xs[0].shape[-1]
          )
          if gp_kernel == "rbf"
          else _get_matern_kernel(
              num_samples=num_mcmc_samples, dim=Xs[0].shape[-1]
          )
          for _ in range(len(Xs))
      ]
  
      models = [
          _get_model(
              X=X.unsqueeze(0).expand(num_mcmc_samples, X.shape[0], -1),
              Y=Y.unsqueeze(0).expand(num_mcmc_samples, Y.shape[0], -1),
              Yvar=Yvar.unsqueeze(0).expand(
                  num_mcmc_samples, Yvar.shape[0], -1
              ),
              fidelity_features=fidelity_features,
              use_input_warping=use_input_warping,
              covar_module=covar_module,
              **kwargs,
          )
          for X, Y, Yvar, covar_module in zip(
              Xs, Ys, Yvars, covar_modules
          )
      ]
      model = ModelListGP(*models)
      model.to(Xs[0])
      return model
  
file_path: Ax/ax/models/torch/fully_bayesian_model_utils.py
imports: from typing import Any, Dict, List, Optional, Tuple
  import pyro
  import torch
  from ax.models.torch.botorch_defaults import _get_model
  from botorch.models.gp_regression import MIN_INFERRED_NOISE_LEVEL
  from botorch.models.gpytorch import GPyTorchModel
  from botorch.models.model_list_gp_regression import ModelListGP
  from gpytorch.kernels import MaternKernel, RBFKernel, ScaleKernel
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _get_single_task_gpytorch_model(Xs, Ys, Yvars, task_features, fidelity_features, state_dict, num_samples, thinning, use_input_warping, gp_kernel) and returns: model