Родитель
e66ee67ebb
Коммит
466148bc72
|
@ -79,7 +79,7 @@ jobs:
|
|||
|
||||
- name: Tests
|
||||
run: |
|
||||
coverage run --source torchmetrics -m pytest torchmetrics tests -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
||||
python -m pytest torchmetrics tests -v --cov=torchmetrics --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
||||
|
||||
- name: Upload pytest test results
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
|
@ -27,8 +27,8 @@ def _test_ddp_sum(rank, worldsize):
|
|||
dummy = DummyMetric()
|
||||
dummy._reductions = {"foo": torch.sum}
|
||||
dummy.foo = torch.tensor(1)
|
||||
|
||||
dummy._sync_dist()
|
||||
|
||||
assert dummy.foo == worldsize
|
||||
|
||||
|
||||
|
@ -38,6 +38,7 @@ def _test_ddp_cat(rank, worldsize):
|
|||
dummy._reductions = {"foo": torch.cat}
|
||||
dummy.foo = [torch.tensor([1])]
|
||||
dummy._sync_dist()
|
||||
|
||||
assert torch.all(torch.eq(dummy.foo, torch.tensor([1, 1])))
|
||||
|
||||
|
||||
|
@ -48,6 +49,7 @@ def _test_ddp_sum_cat(rank, worldsize):
|
|||
dummy.foo = [torch.tensor([1])]
|
||||
dummy.bar = torch.tensor(1)
|
||||
dummy._sync_dist()
|
||||
|
||||
assert torch.all(torch.eq(dummy.foo, torch.tensor([1, 1])))
|
||||
assert dummy.bar == worldsize
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
coverage>=5.0
|
||||
coverage>=5.2
|
||||
codecov>=2.1
|
||||
pytest>=5.0
|
||||
pytest-cov
|
||||
pytest>=6.0
|
||||
pytest-cov>2.10
|
||||
pytest-xdist
|
||||
# pytest-flake8
|
||||
flake8
|
||||
check-manifest
|
||||
|
|
|
@ -69,6 +69,8 @@ def auc(x: torch.Tensor, y: torch.Tensor, reorder: bool = False) -> torch.Tensor
|
|||
>>> y = torch.tensor([0, 1, 2, 2])
|
||||
>>> auc(x, y)
|
||||
tensor(4.)
|
||||
>>> auc(x, y, reorder=True)
|
||||
tensor(4.)
|
||||
"""
|
||||
x, y = _auc_update(x, y)
|
||||
return _auc_compute(x, y, reorder=reorder)
|
||||
|
|
Загрузка…
Ссылка в новой задаче