bf0a734c41ba5df9cc1f7714e45afa820d9aa0a4,tests/ignite/metrics/test_mean_pairwise_distance.py,,test_compute,#,20

Before Change


def test_compute():
    mpd = MeanPairwiseDistance()

    y_pred = torch.Tensor([[3.0, 4.0], [-3.0, -4.0]])
    y = torch.zeros(2, 2)
    mpd.update((y_pred, y))
    assert isinstance(mpd.compute(), float)
    assert mpd.compute() == approx(5.0)

    mpd.reset()
    y_pred = torch.Tensor([[4.0, 4.0, 4.0, 4.0], [-4.0, -4.0, -4.0, -4.0]])
    y = torch.zeros(2, 4)
    mpd.update((y_pred, y))
    assert isinstance(mpd.compute(), float)
    assert mpd.compute() == approx(8.0)

After Change



        return test_cases

    for _ in range(10):
        // check multiple random inputs as random exact occurencies are rare
        test_cases = get_test_cases()
        for y_pred, y, batch_size in test_cases:
            _test(y_pred, y, batch_size)


def _test_distrib_integration(device):

    from ignite.engine import Engine
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 26

Instances


Project Name: pytorch/ignite
Commit Name: bf0a734c41ba5df9cc1f7714e45afa820d9aa0a4
Time: 2021-04-03
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_mean_pairwise_distance.py
Class Name:
Method Name: test_compute


Project Name: pytorch/ignite
Commit Name: bf0a734c41ba5df9cc1f7714e45afa820d9aa0a4
Time: 2021-04-03
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_mean_pairwise_distance.py
Class Name:
Method Name: test_compute


Project Name: pytorch/ignite
Commit Name: d658c8b1a2627beb7f9cc6e84b3bdcf227fc3b6d
Time: 2021-04-07
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_root_mean_squared_error.py
Class Name:
Method Name: test_compute


Project Name: pytorch/ignite
Commit Name: 4adc11552a1f14ccfa61f26c8a0924c693a6f850
Time: 2021-04-01
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_mean_absolute_error.py
Class Name:
Method Name: test_compute


Project Name: pytorch/ignite
Commit Name: 83bed4635a04438df1a9dc6ac399d087cf09f015
Time: 2021-04-03
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_mean_squared_error.py
Class Name:
Method Name: test_compute