7634391b070859dc1c11b092fde754dbc7911d4a,test/test_losses.py,TestDiceLoss,test_all_zeros,#TestDiceLoss#,207
Before Change
logits[:, 0] = 10.0
logits[:, 1] = 1.0
logits[:, 2] = 1.0
labels = torch.zeros(2, 1, 2, dtype=torch.int64).to(device)
criterion = kornia.losses.DiceLoss()
loss = criterion(logits, labels)
assert pytest.approx(loss.item(), 0.0)
After Change
criterion = kornia.losses.DiceLoss()
loss = criterion(logits, labels)
assert_allclose(loss, torch.zeros_like(loss), rtol=1e-3, atol=1e-3)
def test_gradcheck(self, device, dtype):
num_classes = 3
logits = torch.rand(2, num_classes, 3, 2, device=device, dtype=dtype)

In pattern: SUPERPATTERN
Frequency: 7
Non-data size: 3
Instances
Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestDiceLoss
Method Name: test_all_zeros
Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestTverskyLoss
Method Name: test_all_zeros
Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestTverskyLoss
Method Name: test_smoke
Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_blur.py
Class Name: TestBoxBlur
Method Name: test_kernel_3x3
Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestDiceLoss
Method Name: test_smoke
Project Name: arraiy/torchgeometry
Commit Name: 73cb3ff00533b03ab64127d2287f9bdfe30c035c
Time: 2021-01-16
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestPSNRLoss
Method Name: test_smoke
Project Name: arraiy/torchgeometry
Commit Name: 7634391b070859dc1c11b092fde754dbc7911d4a
Time: 2021-01-12
Author: edgar.riba@gmail.com
File Name: test/test_losses.py
Class Name: TestSSIMLoss
Method Name: test_ssim