Added available_device in test_classification_report (#3335)#3342
Added available_device in test_classification_report (#3335)#3342vfdev-5 merged 5 commits intopytorch:masterfrom
Conversation
* Added test_compute_multiclass and test_compute_multilabel to automatically use the available_device fixture in pytest.
|
|
||
|
|
||
| @pytest.mark.parametrize("n_times", range(5)) | ||
| def test_compute_multiclass(n_times, available_device): |
There was a problem hiding this comment.
Let's refactor _test_integration_multiclass test such that we could call it in usual and distributed configs. It is not good to copy-paste the code. Same for the second test method.
There was a problem hiding this comment.
@vfdev-5 Thank you for your advice! So, should I refactor _test_integration_multiclass and _test_integration_multilabel to extract the common logic and make it reusable for both the usual and distributed configurations?
There was a problem hiding this comment.
yes, we should extract the common code that could be used with 1) the new test you have written with available_device and 2) distributed test.
There was a problem hiding this comment.
@vfdev-5 Hello! I have made a new commit. Could you check it for me?
* Added `_test_multiclass` and `_test_multilabel` * Updated `_test_integration_multiclass` and `_test_integration_multilabel` * Updated `test_compute_multiclass` and `test_compute_multilabel`
|
Hi @vfdev-5, sorry for the reminder, but I just wanted to kindly check if you had a chance to review my recent commit regarding the refactored tests. Let me know if there’s anything I should improve or revise! |
Fixes #3335Related #3335 (as we should not close the issue with this PR as it does not address all the tasks)
Description: