code: def test_triplet_margin_loss_with_ref(self):
      for dtype in TEST_DTYPES:
          (
              embeddings,
              labels,
              ref_emb,
              ref_labels,
              triplets,
          ) = get_triplet_embeddings_with_ref(dtype, TEST_DEVICE)
          self.helper(
              embeddings, labels, triplets, dtype, ref_emb, ref_labels
          )
  
file_path: pytorch-metric-learning/tests/losses/test_triplet_margin_loss.py
imports: import unittest
  import torch
  from pytorch_metric_learning.distances import CosineSimilarity
  from pytorch_metric_learning.losses import TripletMarginLoss
  from pytorch_metric_learning.reducers import MeanReducer
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
  from .utils import get_triplet_embeddings_with_ref
label_desc: Use image node_id 2 for calling the TestTripletMarginLoss obj's underlying member method code with example usage: obj.test_triplet_margin_loss_with_ref() without return types