-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Refactor test BoxOps #4596
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
Refactor test BoxOps #4596
Conversation
Hi @Chandan-h-509! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
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 @Chandan-h-509 ,
I think that the parametrization that @fmassa had in mind originally is a bit different from what is proposed here. Instead of parametrizating over the int and float values, I think the goal is rather to parametrize over the box creation functions, the expected values, etc.
Essentially we would only have one single class like
@pytest.mark.parametrize('box_fn, box_tensor, expected_values', (
(ops.box_area, <the_box_tensor_here>, <the_expected_values_here>)
(ops.box_iou, <the_box_tensor_here>, <the_expected_values_here>)
(ops.generalized_box_iou, <the_box_tensor_here>, <the_expected_values_here>)
)
class TestBox:
...
With potentially other parameters as needed
Does that make sense?
@pytest.mark.parametrize("int_dtype", [torch.int8, torch.int16, torch.int32, torch.int64]) | ||
@pytest.mark.parametrize("float_dtype", [torch.float32, torch.float64]) |
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.
As explained above I think this isn't the parametrization we're looking for, but just a note: this parametrization here will make a cross-product over the int values and the float values, equivalent to this:
for int_dtype in int_values:
for float_dtype in float_values:
the_test_body_here()
So this isn't equivalent to the previous tests, which looked like this:
for int_dtype in int_values:
do_something;
for float_dtype in float_values:
do_something_else()
ohk. I will do the necessary changes |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@Chandan-h-509 Happy new year. Do you plan to complete the PR or should we place the issue "up for grabs" for other contributors? Let us know, thanks! |
Due to inactivity I'll place the ticket as "up for grabs". Ping me if you want to pick it up again. Thanks! |
Fixes #4500