code: def test_normalized_dist_mining(self):
      for dtype in TEST_DTYPES:
          angles = [0, 20, 40, 60, 80, 100, 120, 140, 160]
          embeddings = torch.tensor(
              [angle_to_coord(a, normalized=True) for a in angles],
              dtype=dtype,
          ).to(TEST_DEVICE)
          a, p, n = self.normalized_dist_miner(embeddings, self.labels)
          self.helper(a, p, n)
          correct_hardest_pos_pair = torch.sqrt(
              torch.sum((embeddings[2] - embeddings[8]) ** 2)
          ).item()
          correct_hardest_neg_pair = torch.sqrt(
              torch.sum((embeddings[1] - embeddings[2]) ** 2)
          ).item()
          places = 2 if dtype == torch.float16 else 5
  
          if WITH_COLLECT_STATS:
              self.assertAlmostEqual(
                  self.normalized_dist_miner.hardest_pos_pair,
                  correct_hardest_pos_pair,
                  places=places,
              )
              self.assertAlmostEqual(
                  self.normalized_dist_miner.hardest_neg_pair,
                  correct_hardest_neg_pair,
                  places=places,
              )
  
file_path: pytorch-metric-learning/tests/miners/test_batch_hard_miner.py
imports: import unittest
  import numpy
  import torch
  from pytorch_metric_learning.distances import CosineSimilarity, LpDistance
  from pytorch_metric_learning.miners import BatchHardMiner
  from ..None import TEST_DEVICE, TEST_DTYPES, WITH_COLLECT_STATS
  from ..zzz_testing_utils.testing_utils import angle_to_coord
label_desc: Use image node_id 4 for calling the TestBatchHardMiner obj's underlying member method code with example usage: obj.test_normalized_dist_mining() without return types