code: def rbf_kernel(X: Tensor, Z: Tensor, lengthscale: Tensor) -> Tensor:
      """Scaled RBF kernel."""
      dist = compute_dists(X=X, Z=Z, lengthscale=lengthscale)
      # pyre-fixme[6]: For 1st param expected `Tensor` but got `float`.
      # pyre-fixme[58]: `**` is not supported for operand types `Tensor` and `int`.
      return torch.exp(-0.5 * (dist**2))
  
imports: import math
  import sys
  import time
  import types
  import warnings
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import pyro
  import torch
  from ax.exceptions.core import AxError
  from ax.models.torch.botorch import BotorchModel, TAcqfConstructor, TBestPointRecommender, TModelConstructor, TModelPredictor, TOptimizer
  from ax.models.torch.botorch_defaults import get_qLogNEI, MIN_OBSERVED_NOISE_LEVEL, recommend_best_observed_point, scipy_optimizer
  from ax.models.torch.botorch_moo import MultiObjectiveBotorchModel
  from ax.models.torch.botorch_moo_defaults import get_qLogNEHVI, pareto_frontier_evaluator
  from ax.models.torch.frontier_utils import TFrontierEvaluator
  from ax.models.torch.fully_bayesian_model_utils import _get_single_task_gpytorch_model, load_mcmc_samples_to_model, pyro_sample_input_warping, pyro_sample_mean, pyro_sample_noise, pyro_sample_outputscale, pyro_sample_saas_lengthscales
  from ax.utils.common.docutils import copy_doc
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast
  from botorch.acquisition import AcquisitionFunction
  from botorch.models.gpytorch import GPyTorchModel
  from botorch.models.model import Model
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.utils.safe_math import logmeanexp
  from gpytorch.kernels.kernel import dist
  from torch import Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: rbf_kernel(X, Z, lengthscale) and returns: torch