80e5ce816b6bf170c1f2a962e455bcd88bc11795,tests/ignite/contrib/metrics/test_average_precision.py,,_test_distrib_binary_input_N,#Any#,205
Before Change
assert isinstance(res, float)
assert average_precision_score(np_y, np_y_pred) == pytest.approx(res)
test_cases = [
(torch.randint(0, 2, size=(10,)).long(), torch.randint(0, 2, size=(10,)).long(), 1),
(torch.randint(0, 2, size=(100,)).long(), torch.randint(0, 2, size=(100,)).long(), 1),
(torch.randint(0, 2, size=(10, 1)).long(), torch.randint(0, 2, size=(10, 1)).long(), 1),
(torch.randint(0, 2, size=(100, 1)).long(), torch.randint(0, 2, size=(100, 1)).long(), 1),
// updated batches
(torch.randint(0, 2, size=(10,)).long(), torch.randint(0, 2, size=(10,)).long(), 16),
(torch.randint(0, 2, size=(100,)).long(), torch.randint(0, 2, size=(100,)).long(), 16),
(torch.randint(0, 2, size=(10, 1)).long(), torch.randint(0, 2, size=(10, 1)).long(), 16),
(torch.randint(0, 2, size=(100, 1)).long(), torch.randint(0, 2, size=(100, 1)).long(), 16),
]
for y_pred, y, batch_size in test_cases:
for _ in range(3):
_test(y_pred, y, batch_size, "cpu")
if device.type != "xla":
_test(y_pred, y, batch_size, idist.device())
def _test_distrib_multilabel_input_N(device):
rank = idist.get_rank()
torch.manual_seed(12)
After Change
]
return test_cases
for _ in range(3):
test_cases = get_test_cases()
for y_pred, y, batch_size in test_cases:
_test(y_pred, y, batch_size, "cpu")
if device.type != "xla":
_test(y_pred, y, batch_size, idist.device())
def _test_distrib_multilabel_input_N(device):
rank = idist.get_rank()
torch.manual_seed(12)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 11
Instances
Project Name: pytorch/ignite
Commit Name: 80e5ce816b6bf170c1f2a962e455bcd88bc11795
Time: 2021-03-12
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/contrib/metrics/test_average_precision.py
Class Name:
Method Name: _test_distrib_binary_input_N
Project Name: pytorch/ignite
Commit Name: 80e5ce816b6bf170c1f2a962e455bcd88bc11795
Time: 2021-03-12
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/contrib/metrics/test_cohen_kappa.py
Class Name:
Method Name: test_binary_input_N
Project Name: pytorch/ignite
Commit Name: b70754ef7bef16dd0fe6391ff757b9033b73c100
Time: 2021-03-12
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_accuracy.py
Class Name:
Method Name: test_multiclass_input
Project Name: pytorch/ignite
Commit Name: 80e5ce816b6bf170c1f2a962e455bcd88bc11795
Time: 2021-03-12
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/contrib/metrics/test_average_precision.py
Class Name:
Method Name: test_binary_input_N
Project Name: pytorch/ignite
Commit Name: b70754ef7bef16dd0fe6391ff757b9033b73c100
Time: 2021-03-12
Author: ahmedkhaled19701@gmail.com
File Name: tests/ignite/metrics/test_accuracy.py
Class Name:
Method Name: test_binary_input