code: def test_input_indices_tuple(self):
      for dtype in TEST_DTYPES:
          batch_size = 32
          pair_miner = PairMarginMiner(pos_margin=0, neg_margin=1)
          triplet_miner = TripletMarginMiner(margin=1)
          self.loss = CrossBatchMemory(
              loss=ContrastiveLoss(),
              embedding_size=self.embedding_size,
              memory_size=self.memory_size,
          )
          for i in range(30):
              embeddings = (
                  torch.randn(batch_size, self.embedding_size)
                  .to(TEST_DEVICE)
                  .type(dtype)
              )
              labels = torch.arange(batch_size).to(TEST_DEVICE)
              self.loss(embeddings, labels)
              for curr_miner in [pair_miner, triplet_miner]:
                  input_indices_tuple = curr_miner(embeddings, labels)
                  a1ii, pii, a2ii, nii = lmu.convert_to_pairs(
                      input_indices_tuple, labels
                  )
                  indices_tuple = lmu.get_all_pairs_indices(
                      labels, self.loss.label_memory
                  )
                  a1i, pi, a2i, ni = lmu.remove_self_comparisons(
                      indices_tuple,
                      self.loss.curr_batch_idx,
                      self.loss.memory_size,
                  )
                  a1, p, a2, n = self.loss.create_indices_tuple(
                      embeddings,
                      labels,
                      self.loss.embedding_memory,
                      self.loss.label_memory,
                      input_indices_tuple,
                      True,
                  )
                  self.assertTrue(
                      not torch.any(
                          (
                              labels[a1] - self.loss.label_memory[p]
                          ).bool()
                      )
                  )
                  self.assertTrue(
                      torch.all(
                          (
                              labels[a2] - self.loss.label_memory[n]
                          ).bool()
                      )
                  )
                  self.assertTrue(
                      torch.all(a1 == torch.cat([a1i, a1ii]))
                  )
                  self.assertTrue(torch.all(p == torch.cat([pi, pii])))
                  self.assertTrue(
                      torch.all(a2 == torch.cat([a2i, a2ii]))
                  )
                  self.assertTrue(torch.all(n == torch.cat([ni, nii])))
  
imports: import unittest
  import torch
  import pytorch_metric_learning.losses
  from pytorch_metric_learning.losses import ContrastiveLoss, CrossBatchMemory, MultiSimilarityLoss, NTXentLoss
  from pytorch_metric_learning.miners import DistanceWeightedMiner, MultiSimilarityMiner, PairMarginMiner, TripletMarginMiner
  from pytorch_metric_learning.utils import loss_and_miner_utils
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
label_desc: Use image node_id 9 for calling the TestCrossBatchMemory obj's underlying member method code with example usage: obj.test_input_indices_tuple() without return types