def METHOD_NAME(self):
    all_embedding_angles = [[0], [0, 10, 20], [0, 40, 60]]
    all_labels = [
        torch.LongTensor([0]),
        torch.LongTensor([0, 0, 0]),
        torch.LongTensor([1, 2, 3]),
    ]
    temperature = 0.1
    for loss_class in [NTXentLoss, SupConLoss]:
        loss_funcA = loss_class(temperature)
        loss_funcB = loss_class(temperature, distance=LpDistance())
        for loss_func in [loss_funcA, loss_funcB]:
            for dtype in TEST_DTYPES:
                for embedding_angles, labels in zip(
                    all_embedding_angles, all_labels
                ):
                    embeddings = torch.tensor(
                        [angle_to_coord(a) for a in embedding_angles],
                        requires_grad=True,
                        dtype=dtype,
                    ).to(
                        TEST_DEVICE
                    )  # 2D embeddings
                    loss = loss_func(embeddings, labels)
                    loss.backward()
                    self.assertEqual(loss, 0)