def METHOD_NAME(self):
    embeddings = torch.randn(32, 512, 3)
    labels = torch.randint(0, 10, size=(32,))
    loss_fn = TripletMarginLoss()
    # embeddings is 3-dimensional
    self.assertRaises(ValueError, lambda: loss_fn(embeddings, labels))
    # embeddings does not match labels
    embeddings = torch.randn(33, 512)
    self.assertRaises(ValueError, lambda: loss_fn(embeddings, labels))
    # labels is 2D
    embeddings = torch.randn(32, 512)
    labels = labels.unsqueeze(1)
    self.assertRaises(ValueError, lambda: loss_fn(embeddings, labels))
    # correct shapes
    labels = labels.squeeze(1)
    self.assertTrue(torch.is_tensor(loss_fn(embeddings, labels)))