e4554604dca45529bebc03c8869fdeaeeb825132,tests/ignite/metrics/test_loss.py,,test_kwargs_loss,#,75

Before Change


def test_kwargs_loss():
    loss = Loss(nll_loss)

    y_pred = torch.tensor([[0.1, 0.4, 0.5], [0.1, 0.7, 0.2]]).log()
    y = torch.tensor([2, 2]).long()
    loss.update((y_pred, y, {"weight": torch.tensor([0, 0, 0], dtype=torch.float)}))
    assert_almost_equal(loss.compute(), 0)

After Change


def test_kwargs_loss():
    loss = Loss(nll_loss)

    y_pred, y, _ = y_test_1()
    loss.update((y_pred, y, {"weight": torch.tensor([0, 0, 0], dtype=torch.float)}))
    assert_almost_equal(loss.compute(), 0)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: pytorch/ignite
Commit Name: e4554604dca45529bebc03c8869fdeaeeb825132
Time: 2021-03-12
Author: momo.ah.yakoub@gmail.com
File Name: tests/ignite/metrics/test_loss.py
Class Name:
Method Name: test_kwargs_loss


Project Name: pytorch/ignite
Commit Name: e4554604dca45529bebc03c8869fdeaeeb825132
Time: 2021-03-12
Author: momo.ah.yakoub@gmail.com
File Name: tests/ignite/metrics/test_loss.py
Class Name:
Method Name: test_non_averaging_loss


Project Name: pytorch/ignite
Commit Name: e4554604dca45529bebc03c8869fdeaeeb825132
Time: 2021-03-12
Author: momo.ah.yakoub@gmail.com
File Name: tests/ignite/metrics/test_loss.py
Class Name:
Method Name: test_sum_detached


Project Name: pytorch/ignite
Commit Name: e4554604dca45529bebc03c8869fdeaeeb825132
Time: 2021-03-12
Author: momo.ah.yakoub@gmail.com
File Name: tests/ignite/metrics/test_loss.py
Class Name:
Method Name: test_kwargs_loss