Skip to content

Commit d415d27

Browse files
author
pfeatherstone
committed
- missing onnxruntime dependency
- fixed CI/CD? - unit tests: increased atol and rtol a bit for scores
1 parent 681f6e6 commit d415d27

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

.github/workflows/ubuntu.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ jobs:
1717
matrix:
1818
os: [ubuntu-22.04, ubuntu-24.04]
1919

20-
env:
21-
TEST_RESULTS_DIR: ${{ github.workspace }}/test-results
22-
2320
steps:
2421
- uses: actions/checkout@v5
2522

@@ -31,24 +28,23 @@ jobs:
3128
- name: Install dependencies
3229
run: pip install -r requirements.txt
3330

34-
- name: Run pytest
31+
- name: Test
3532
run: |
36-
mkdir -p "$TEST_RESULTS_DIR"
3733
cd src
38-
pytest --junitxml="$TEST_RESULTS_DIR/results.xml" test_unit.py
34+
pytest test_unit.py --doctest-modules --junitxml=junit/test-results-${{ matrix.os }}.xml
3935
40-
- name: Upload test results (JUnit XML)
41-
if: always()
36+
- name: Upload test results
37+
if: ${{ always() }}
4238
uses: actions/upload-artifact@v4
4339
with:
44-
name: pytorch-unit-test-results-${{ matrix.os }}
45-
path: test-results/results.xml
40+
name: pytest-results-${{ matrix.os }}
41+
path: junit/test-results-${{ matrix.os }}.xml
4642

4743
- name: Publish test report to PR
4844
if: always()
4945
uses: dorny/test-reporter@v1
5046
with:
5147
name: PyTorch Unit Tests (${{ matrix.os }})
52-
path: test-results/results.xml
48+
path: junit/test-results-${{ matrix.os }}.xml
5349
reporter: java-junit
5450
fail-on-error: "false"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ torch
44
torchvision
55
einops
66
onnx
7+
onnxruntime
78
onnxscript
89
lightning
910
tensorboard

src/test_unit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ def test_export(net: YoloBase):
5050
x = torch.randn(2, 3, 576, 768)
5151
preds1 = net(x)
5252
preds2, = netOrt.run(None, {'img': x.numpy()})
53-
torch.testing.assert_close(preds1[...,:4], torch.from_numpy(preds2[...,:4]), atol=1e-3, rtol=1e-2) # boxes
54-
torch.testing.assert_close(preds1[...,4:], torch.from_numpy(preds2[...,4:])) # scores
53+
torch.testing.assert_close(preds1[...,:4], torch.from_numpy(preds2[...,:4]), atol=1e-3, rtol=1e-2) # boxes
54+
torch.testing.assert_close(preds1[...,4:], torch.from_numpy(preds2[...,4:]), atol=5e-5, rtol=1e-4) # scores

0 commit comments

Comments
 (0)