code: def test_backward(self):
      margin = 10
      scale = 2
      for dtype in TEST_DTYPES:
          loss_funcA = LargeMarginSoftmaxLoss(
              margin=margin,
              scale=scale,
              num_classes=10,
              embedding_size=2,
          )
          loss_funcB = SphereFaceLoss(
              margin=margin,
              scale=scale,
              num_classes=10,
              embedding_size=2,
          )
          for loss_func in [loss_funcA, loss_funcB]:
              embedding_angles = torch.arange(0, 180)
              # multiply by 10 to make the embeddings unnormalized
              embeddings = torch.tensor(
                  np.array(
                      [angle_to_coord(a) for a in embedding_angles]
                  )
                  * 10,
                  requires_grad=True,
                  dtype=dtype,
              ).to(
                  TEST_DEVICE
              )  # 2D embeddings
              labels = torch.randint(low=0, high=10, size=(180,)).to(
                  TEST_DEVICE
              )
  
              loss = loss_func(embeddings, labels)
              loss.backward()
  
file_path: pytorch-metric-learning/tests/losses/test_large_margin_softmax_loss.py
imports: import math
  import unittest
  import numpy
  import scipy
  import torch
  from pytorch_metric_learning.losses import LargeMarginSoftmaxLoss, SphereFaceLoss
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
label_desc: Use image node_id 2 for calling the TestLargeMarginSoftmaxLoss obj's underlying member method code with example usage: obj.test_backward() without return types