code: def test_subset_active_compute_rational_quadratic(self):
      a = torch.tensor([4, 2, 8], dtype=torch.float).view(3, 1)
      a_p = torch.tensor([1, 2, 3], dtype=torch.float).view(3, 1)
      a = torch.cat((a, a_p), 1)
      b = torch.tensor([0, 2, 4], dtype=torch.float).view(3, 1)
      lengthscale = 2
  
      kernel = RQKernel(active_dims=[0])
      kernel.initialize(lengthscale=lengthscale)
      kernel.initialize(alpha=3.0)
      kernel.eval()
  
      actual = torch.tensor(
          [[16, 4, 0], [4, 0, 4], [64, 36, 16]], dtype=torch.float
      )
      actual.div_(lengthscale**2).div_(2 * kernel.alpha).add_(1).pow_(
          -kernel.alpha
      )
      res = kernel(a, b).to_dense()
      self.assertLess(torch.norm(res - actual), 1e-5)
  
      # diag
      res = kernel(a, b).diagonal(dim1=-1, dim2=-2)
      actual = actual.diagonal(dim1=-1, dim2=-2)
      self.assertLess(torch.norm(res - actual), 1e-5)
  
file_path: gpytorch/test/kernels/test_rq_kernel.py
imports: import math
  import unittest
  import torch
  from gpytorch.kernels import RQKernel
  from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
label_desc: Use image node_id 8 for calling the TestRQKernel obj's underlying member method code with example usage: obj.test_subset_active_compute_rational_quadratic() without return types