code: def test_kernel_evaluation_map(self):
      kernel = MaternKernel(
          nu=2.5, ard_num_dims=2, batch_shape=Size([2])
      )
      kernel.to(device=self.device)
      with torch.random.fork_rng():
          torch.manual_seed(0)
          kernel.lengthscale = 0.1 + 0.3 * torch.rand_like(
              kernel.lengthscale
          )
  
      with self.assertRaisesRegex(RuntimeError, "Shape mismatch"):
          KernelEvaluationMap(kernel=kernel, points=torch.rand(4, 3, 2))
  
      for dtype in (torch.float32, torch.float64):
          kernel.to(dtype=dtype)
          X0, X1 = torch.rand(
              5, 2, dtype=dtype, device=self.device
          ).split([2, 3])
          kernel_map = KernelEvaluationMap(kernel=kernel, points=X1)
          self.assertEqual(kernel_map.batch_shape, kernel.batch_shape)
          self.assertEqual(kernel_map.num_outputs, X1.shape[-1])
          self.assertTrue(
              kernel_map(X0).to_dense().equal(kernel(X0, X1).to_dense())
          )
  
      with patch.object(
          kernel_map,
          "output_transform",
          new=lambda z: torch.concat([z, z], dim=-1),
      ):
          self.assertEqual(kernel_map.num_outputs, 2 * X1.shape[-1])
  
file_path: botorch/test/sampling/pathwise/features/test_maps.py
imports: from __future__ import annotations
  from unittest.mock import MagicMock, patch
  import torch
  from botorch.sampling.pathwise.features import KernelEvaluationMap, KernelFeatureMap
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.kernels import MaternKernel
  from torch import Size
label_desc: Use image node_id 1 for calling the TestFeatureMaps obj's underlying member method code with example usage: obj.test_kernel_evaluation_map() without return types