code: def test_histogram_loss(self):
      batch_size = 32
      embedding_size = 64
      for dtype in TEST_DTYPES:
          num_steps = 5 if dtype == torch.float16 else 21
          num_bins = num_steps - 1
          loss_func = HistogramLoss(n_bins=num_bins)
          original_loss_func = OriginalImplementationHistogramLoss(
              num_steps=num_steps, cuda=False
          )
  
          # test multiple times
          for _ in range(2):
              embeddings = torch.randn(
                  batch_size,
                  embedding_size,
                  requires_grad=True,
                  dtype=dtype,
              ).to(TEST_DEVICE)
              labels = torch.randint(0, 5, size=(batch_size,))
  
              loss = loss_func(embeddings, labels)
              correct_loss = original_loss_func(
                  torch.nn.functional.normalize(embeddings), labels
              )
  
              rtol = 1e-2 if dtype == torch.float16 else 1e-5
              self.assertTrue(
                  torch.isclose(loss, correct_loss, rtol=rtol)
              )
  
              loss.backward()
  
file_path: pytorch-metric-learning/tests/losses/test_histogram_loss.py
imports: import unittest
  import torch
  from numpy.testing import assert_almost_equal
  from pytorch_metric_learning.losses import HistogramLoss
  from pytorch_metric_learning.utils import common_functions
  from ..None import TEST_DEVICE, TEST_DTYPES
label_desc: Use image node_id 1 for calling the TestHistogramLoss obj's underlying member method code with example usage: obj.test_histogram_loss() without return types