code: def _run(
      self, nn_util, dim, batch_shape, train_n, test_n, seq_train_n=None
  ):
      train_x = torch.randn(*batch_shape, train_n, dim)
      test_x = torch.randn(*batch_shape, test_n, dim)
      k = nn_util.k
  
      # set training data
      nn_util.set_nn_idx(train_x)
  
      # test nn search
      test_nn_indices = nn_util.find_nn_idx(test_x)
      self.assertEqual(test_nn_indices.shape, (*batch_shape, test_n, k))
  
      # build sequential nn structure
      if seq_train_n is None:
          seq_train_x = train_x
          seq_train_n = train_n
      else:
          seq_train_x = torch.randn(*batch_shape, seq_train_n, dim)
      sequential_nn_idx = nn_util.build_sequential_nn_idx(seq_train_x)
      self.assertEqual(
          sequential_nn_idx.shape, (*batch_shape, seq_train_n - k, k)
      )
  
file_path: gpytorch/test/utils/test_nearest_neighbors.py
imports: import unittest
  import torch
  from gpytorch.utils.nearest_neighbors import NNUtil
label_desc: Use image node_id 2 for calling the TestNNUtil obj's underlying member method code with example usage: obj._run(nn_util, dim, batch_shape, train_n, test_n, seq_train_n) without return types