code: def test_ntxent_loss(self):
      torch.manual_seed(5430)
      for dtype in TEST_DTYPES:
          embedding_angles = [0, 10, 20, 50, 60, 80]
          embeddings = torch.tensor(
              [
                  angle_to_coord(a, normalized=True)
                  for a in embedding_angles
              ],
              requires_grad=True,
              dtype=dtype,
          ).to(
              TEST_DEVICE
          )  # 2D embeddings
  
          labels = torch.LongTensor([0, 0, 0, 1, 1, 2])
          pos_pairs = [
              (0, 1),
              (0, 2),
              (1, 0),
              (1, 2),
              (2, 0),
              (2, 1),
              (3, 4),
              (4, 3),
          ]
          neg_pairs = [
              (0, 3),
              (0, 4),
              (0, 5),
              (1, 3),
              (1, 4),
              (1, 5),
              (2, 3),
              (2, 4),
              (2, 5),
              (3, 0),
              (3, 1),
              (3, 2),
              (3, 5),
              (4, 0),
              (4, 1),
              (4, 2),
              (4, 5),
              (5, 0),
              (5, 1),
              (5, 2),
              (5, 3),
              (5, 4),
          ]
  
          self.helper(embeddings, labels, pos_pairs, neg_pairs, dtype)
  
file_path: pytorch-metric-learning/tests/losses/test_ntxent_loss.py
imports: import unittest
  import torch
  from pytorch_metric_learning.distances import LpDistance
  from pytorch_metric_learning.losses import NTXentLoss, SupConLoss
  from pytorch_metric_learning.reducers import AvgNonZeroReducer, PerAnchorReducer
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
  from .utils import get_pair_embeddings_with_ref
label_desc: Use image node_id 1 for calling the TestNTXentLoss obj's underlying member method code with example usage: obj.test_ntxent_loss() without return types