Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions tests/ignite/contrib/metrics/regression/test__base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ def test_torch_median_numpy(size, device: Optional[str] = None):
assert _torch_median(data) == np.median(data.cpu().numpy())


@pytest.mark.parametrize("size", [101, (31, 3)])
def test_torch_median_quantile(size, device: Optional[str] = None):
data = torch.rand(size).to(device)
assert _torch_median(data) == torch.quantile(data, 0.5, interpolation="midpoint")

size = 101
data = torch.rand(size=(size,))
assert _torch_median(data) == torch.median(data)


@pytest.mark.tpu
@pytest.mark.parametrize("size", [100, 101, (30, 3), (31, 3)])
@pytest.mark.skipif(not idist.has_xla_support, reason="Skip if no PyTorch XLA package")
Expand All @@ -78,22 +68,3 @@ def test_on_even_size_gpu(size):
@pytest.mark.parametrize("size", [100, 101, (30, 3), (31, 3)])
def test_create_even_size_cpu(size):
test_torch_median_numpy(size, device="cpu")


@pytest.mark.tpu
@pytest.mark.parametrize("size", [101, (31, 3)])
@pytest.mark.skipif(not idist.has_xla_support, reason="Skip if no PyTorch XLA package")
def test_on_odd_size_xla(size):
device = "xla"
test_torch_median_quantile(size, device=device)


@pytest.mark.parametrize("size", [101, (31, 3)])
@pytest.mark.skipif(not torch.cuda.is_available(), reason="Skip if no GPU")
def test_on_odd_size_gpu(size):
test_torch_median_quantile(size, device="cuda")


@pytest.mark.parametrize("size", [101, (31, 3)])
def test_create_odd_size_cpu(size):
test_torch_median_quantile(size, device="cpu")