code: def test_quadratic_kernel_batch(self):
      a = torch.tensor([[4, 2, 8], [1, 2, 3]], dtype=torch.float).view(
          2, 3, 1
      )
      b = torch.tensor([[0, 2, 1], [-1, 2, 0]], dtype=torch.float).view(
          2, 3, 1
      )
      kernel = PolynomialKernel(
          power=2, batch_shape=torch.Size([2])
      ).initialize(offset=torch.rand(2, 1))
      kernel.eval()
  
      actual = torch.zeros(2, 3, 3)
      for k in range(2):
          for i in range(3):
              for j in range(3):
                  actual[k, i, j] = (
                      a[k, i].matmul(b[k, j]) + kernel.offset[k]
                  ).pow(kernel.power)
  
      res = kernel(a, b).to_dense()
      self.assertLess(torch.norm(res - actual), 1e-5)
  
file_path: gpytorch/test/kernels/test_polynomial_kernel.py
imports: import unittest
  import torch
  from gpytorch.kernels import PolynomialKernel
  from gpytorch.priors import NormalPrior
  from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
label_desc: Use image node_id 4 for calling the TestPolynomialKernel obj's underlying member method code with example usage: obj.test_quadratic_kernel_batch() without return types