ultralytics 8.1.1 Docs, Solutions and Export updates (#7545)

Co-authored-by: Sergiu Waxmann <47978446+sergiuwaxmann@users.noreply.github.com>
Co-authored-by: Vivek Malvi <malvivivek8198@gmail.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: psaxton <psaxton+github.com@gmail.com>
This commit is contained in:
Glenn Jocher 2024-01-12 16:48:57 +01:00 committed by GitHub
parent 30185e0d4c
commit 83165ffe9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 26 deletions

View file

@ -463,6 +463,21 @@ def test_utils_files():
print(new_path)
@pytest.mark.slow
def test_utils_patches_torch_save():
"""Test torch_save backoff when _torch_save throws RuntimeError."""
from unittest.mock import patch, MagicMock
from ultralytics.utils.patches import torch_save
mock = MagicMock(side_effect=RuntimeError)
with patch('ultralytics.utils.patches._torch_save', new=mock):
with pytest.raises(RuntimeError):
torch_save(torch.zeros(1), TMP / 'test.pt')
assert mock.call_count == 4, "torch_save was not attempted the expected number of times"
def test_nn_modules_conv():
"""Test Convolutional Neural Network modules."""
from ultralytics.nn.modules.conv import CBAM, Conv2, ConvTranspose, DWConvTranspose2d, Focus