code: def helper(
      self,
      embeddings,
      labels,
      dtype,
      ref_emb=None,
      ref_labels=None,
      min_val=-2.0,
      num_bins=10,
  ):
      loss_func = DynamicSoftMarginLoss(
          min_val=min_val, num_bins=num_bins
      )
      original_loss_func = OriginalImplementationDynamicSoftMarginLoss(
          max_dist=-min_val, nbins=num_bins
      )
  
      loss = loss_func(
          embeddings, labels, ref_emb=ref_emb, ref_labels=ref_labels
      )
      if labels is None:
          embeddings = torch.cat((embeddings, ref_emb))
      correct_loss = original_loss_func(embeddings, labels)
  
      rtol = 1e-2 if dtype == torch.float16 else 1e-5
      self.assertTrue(torch.isclose(loss, correct_loss, rtol=rtol))
  
imports: import torch
  import torch.nn
  from pytorch_metric_learning.utils import common_functions
  from pytorch_metric_learning.utils import loss_and_miner_utils
  import unittest
  from pytorch_metric_learning.losses import DynamicSoftMarginLoss
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
label_desc: Use image node_id 3 for calling the TestDynamicSoftMarginLoss obj's underlying member method code with example usage: obj.helper(embeddings, labels, dtype, ref_emb, ref_labels, min_val, num_bins) without return types