code: def test_subset_active_computes_rational_quadratic_gradient(self):
      softplus = torch.nn.functional.softplus
      a_1 = 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_1, a_p), 1)
      b = torch.tensor([0, 2, 2], dtype=torch.float).view(3, 1)
  
      kernel = RQKernel(active_dims=[0])
      kernel.initialize(lengthscale=2.0)
      kernel.initialize(alpha=3.0)
      kernel.eval()
  
      raw_lengthscale = torch.tensor(math.log(math.exp(2.0) - 1))
      raw_lengthscale.requires_grad_()
      raw_alpha = torch.tensor(math.log(math.exp(3.0) - 1))
      raw_alpha.requires_grad_()
      lengthscale, alpha = softplus(raw_lengthscale), softplus(
          raw_alpha
      )
      dist = (
          (a_1.expand(3, 3) - b.expand(3, 3).transpose(0, 1))
          .div(lengthscale)
          .pow(2)
      )
      actual_output = dist.div(2 * alpha).add(1).pow(-alpha)
      actual_output.backward(gradient=torch.eye(3))
  
      output = kernel(a, b).to_dense()
      output.backward(gradient=torch.eye(3))
  
      res = kernel.raw_lengthscale.grad
      self.assertLess(torch.norm(res - raw_lengthscale.grad), 1e-5)
      res = kernel.raw_alpha.grad
      self.assertLess(torch.norm(res - raw_alpha.grad), 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 9 for calling the TestRQKernel obj's underlying member method code with example usage: obj.test_subset_active_computes_rational_quadratic_gradient() without return types