-
-
Notifications
You must be signed in to change notification settings - Fork 650
Added available_device in test_classification_report (#3335) #3342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Added test_compute_multiclass and test_compute_multilabel to automatically use the available_device fixture in pytest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @HyeSungP !
This test suite looks a bit particular and we need to rework it a bit. I left a comment.
@@ -159,6 +159,158 @@ def update(engine, i): | |||
_test(metric_device, 2, ["0", "1", "2", "3", "4", "5", "6"]) | |||
|
|||
|
|||
@pytest.mark.parametrize("n_times", range(5)) | |||
def test_compute_multiclass(n_times, available_device): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @HyeSungP !
Sorry for delay on reviewing the PR!
Fixes #3335Related #3335 (as we should not close the issue with this PR as it does not address all the tasks)
Description: