code: def test_remove_self_comparisons_small_ref(self):
      labels = torch.tensor([0, 0, 1])
      labels2 = torch.tensor([1, 1, 0, 0])
      all_labels = torch.cat([labels, labels2])
      curr_batch_idx = torch.arange(3, 7)
      correct_a1 = torch.tensor([0, 0, 1, 1, 2, 2, 3, 4, 5, 6])
      correct_p = torch.tensor([2, 3, 2, 3, 0, 1, 1, 0, 3, 2])
  
      indices_tuple = lmu.get_all_pairs_indices(all_labels, labels2)
      ref_size = len(labels2)
      indices_tuple = lmu.remove_self_comparisons(
          indices_tuple, curr_batch_idx, ref_size, ref_is_subset=True
      )
      a1, p, a2, n = indices_tuple
      self.assertTrue(torch.equal(a1, correct_a1))
      self.assertTrue(torch.equal(p, correct_p))
  
file_path: pytorch-metric-learning/tests/utils/test_loss_and_miner_utils.py
imports: import unittest
  import torch
  from pytorch_metric_learning.utils import loss_and_miner_utils
  from ..None import TEST_DEVICE, TEST_DTYPES
label_desc: Use image node_id 7 for calling the TestLossAndMinerUtils obj's underlying member method code with example usage: obj.test_remove_self_comparisons_small_ref() without return types