-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix output_shape of a testcase for ConvTranspose #1437
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
As per the documentation of the operator, `output_shape` seems to expect the same rank as other attributes such as `strides` or `pads`. In other words, `output_shape` should not have dimensions for batch size and number of channels. So this changes `output_shape` from [1, 2, 10, 8] to [10, 8] for the 2D ConvTranspose. Note that test_convtranspose_kernel_shape, the other test which uses `output_shape`, is already OK.
I failed to get an attention in #1158 so decided to send a PR to see if my understanding is right. Comments are welcomed, 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.
Hi shinh! Sorry didnt reply you in #1158 .
I have reviewed your commit, and it seems you are right. Altought whether to use the full shape(NCHW instead of HW) is still considerable now, it does not make sense if there is inconsistency.
Could you please update the document by running
onnx/defs/gen_doc.py
onnx/gen/proto.py (I guess you dont have to run this)
onnx/backend/test/stat_coverage.py
and also upload new test data for convtranspose?
Thanks for your contribution to ONNX!
Note there are a few unrelated updates.
Thanks for your quick review! I've updated those documents. I think my original commit had updated model.onnx and test_data_set_0 was unchanged since this PR changes inputs/outputs. I've just double-checked there are no update by doing
|
I'm not sure why stat_coverage.py used vgg16 for me although it was renamed, but anyway, now the tests seem to be passing. |
@shinh Hi shinh, I wonder if this is ready to be merged? |
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
Yes, I believe this PR is OK. Thanks again for your review! |
* Fix output_shape of a testcase for ConvTranspose As per the documentation of the operator, `output_shape` seems to expect the same rank as other attributes such as `strides` or `pads`. In other words, `output_shape` should not have dimensions for batch size and number of channels. So this changes `output_shape` from [1, 2, 10, 8] to [10, 8] for the 2D ConvTranspose. Note that test_convtranspose_kernel_shape, the other test which uses `output_shape`, is already OK. * Update the document by gen_doc.py * Update test coverage by stat_coverage.py Note there are a few unrelated updates. * Revert unrelated update in the previous commit
* Fix output_shape of a testcase for ConvTranspose As per the documentation of the operator, `output_shape` seems to expect the same rank as other attributes such as `strides` or `pads`. In other words, `output_shape` should not have dimensions for batch size and number of channels. So this changes `output_shape` from [1, 2, 10, 8] to [10, 8] for the 2D ConvTranspose. Note that test_convtranspose_kernel_shape, the other test which uses `output_shape`, is already OK. * Update the document by gen_doc.py * Update test coverage by stat_coverage.py Note there are a few unrelated updates. * Revert unrelated update in the previous commit
…els (#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, #1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
…els (onnx#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, onnx#1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…els (onnx#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, onnx#1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Megan Hampton <hamptonm@us.ibm.com>
…els (onnx#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, onnx#1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…els (onnx#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, onnx#1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…els (onnx#5400) ### Description <!-- - Describe your changes. --> Add a sentence to highlight that output_shape for ConvTranspose should not have batch and channels. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? --> <!-- - If it fixes an open issue, please link to the issue here. --> It's quite confusing that whether output_shape needs to be fully provided. For instance, onnx#1437. An explicit description should help prevent confusion. cc @satyajandhyala --------- Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Aditya Goel <agoel4512@gmail.com>
As per the documentation of the operator,
output_shape
seemsto expect the same rank as other attributes such as
strides
or
pads
. In other words,output_shape
should not havedimensions for batch size and number of channels. So this
changes
output_shape
from [1, 2, 10, 8] to [10, 8] for the2D ConvTranspose.
Note that test_convtranspose_kernel_shape, the other test which
uses
output_shape
, is already OK.