Skip to content

Commit

Permalink
Update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
QibinLiang committed Oct 11, 2023
1 parent 855baa6 commit e4b1f39
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions tests/losses/test_multilabel_supcon_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_xbm_multisupcon_val(self):
self.test_xbm_multisupcon_val_gt[dtype][b],
atol=1e-2 if dtype == torch.float16 else 1e-4))


def test_with_no_valid_pairs(self):
for dtype in TEST_DTYPES:
embedding_angles = [0]
Expand All @@ -105,21 +106,6 @@ def test_with_no_valid_pairs(self):
loss.backward()
self.assertEqual(loss, 0)

def test_(self):
for dtype in TEST_DTYPES:
embedding_angles = [0]
embeddings = torch.tensor(
[angle_to_coord(a) for a in embedding_angles],
requires_grad=True,
dtype=dtype,
).to(
TEST_DEVICE
) # 2D embeddings
labels = torch.LongTensor([[0]])
loss = self.loss_func(embeddings, labels)
loss.backward()
self.assertEqual(loss, 0)


def test_backward(self):
for dtype in TEST_DTYPES:
Expand Down

0 comments on commit e4b1f39

Please sign in to comment.