Skip to content
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

Add Col2Im operator #3948

Merged
merged 10 commits into from
Aug 29, 2022
Merged

Add Col2Im operator #3948

merged 10 commits into from
Aug 29, 2022

Conversation

thiagocrepaldi
Copy link

@thiagocrepaldi thiagocrepaldi commented Jan 14, 2022

Description
Introduces an operator Col2Im() that rearranges input tensor in blocks. Same behavior as https://pytorch.org/cppdocs/api/function_namespaceat_1a979fbf85d8c7362d60d766bbf1639f10.html

Fixes #4106

Motivation and Context

microsoft/onnxruntime#12311 ORT implemented the spec proposed here for Col2Im with n-dimensional support as a contrib op.

@thiagocrepaldi thiagocrepaldi force-pushed the thiagofc/add-col2im branch 3 times, most recently from 628d371 to 4e5a34d Compare January 18, 2022 16:24
@thiagocrepaldi
Copy link
Author

@askhade Could you check whether I am going towards the right direction with this PR?

@askhade
Copy link
Contributor

askhade commented Jan 18, 2022

DCO is not signed for this PR. If you only have a single commit then it is easy to fix it... Just follow the directions here:
https://github.com/onnx/onnx/pull/3948/checks?check_run_id=4856175809

In future adding -s option to git commit adds sign off for that commit. example:
git commit -s -m "some comment"

onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
@askhade
Copy link
Contributor

askhade commented Jan 18, 2022

Few more comments:

  1. Run flake 8 in local repo. CIs are reporting errors from flake8
python -m pip install -q flake8
flake8 onnx
  1. Generate test data and add it to "https://github.com/onnx/onnx/tree/main/onnx/backend/test/data/node". This step picks your node unit test and creates onnx models + test data.
python onnx/backend/test/cmd_tools.py generate-data --op_type Col2Im --output <optional. provide output directory>

The script can be found here: https://github.com/onnx/onnx/blob/main/onnx/backend/test/cmd_tools.py#L90

  1. Make sure you are not manually editing the Changlelog.md, Operators.md and TestCoverage.md files. You can use this script to auto generate them:
python onnx/backend/test/stat_coverage.py
python onnx/defs/gen_doc.py
ONNX_ML=0 python onnx/defs/gen_doc.py

Copy link
Contributor

@askhade askhade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added comments

@askhade askhade added topic: enhancement Request for new feature or operator topic: operator Issues related to ONNX operators labels Jan 18, 2022
@askhade askhade added this to the 1.11 milestone Jan 18, 2022
@thiagocrepaldi thiagocrepaldi force-pushed the thiagofc/add-col2im branch 4 times, most recently from 1498202 to 462b7fd Compare January 18, 2022 22:42
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
onnx/defs/tensor/defs.cc Outdated Show resolved Hide resolved
@askhade
Copy link
Contributor

askhade commented Jan 19, 2022

fix DCO

@thiagocrepaldi thiagocrepaldi force-pushed the thiagofc/add-col2im branch 3 times, most recently from d7644bc to b0878cb Compare January 19, 2022 19:42
@thiagocrepaldi
Copy link
Author

@askhade Could you dismiss your review? All comments were addressed back in the day, but I have no permission to dismiss nor request another review. Feel free to give it another go on the review too

@thiagocrepaldi
Copy link
Author

@askhade Could you dismiss your review? All comments were addressed back in the day, but I have no permission to dismiss nor request another review. Feel free to give it another go on the review too

gentle ping

Thiago Crepaldi added 10 commits August 25, 2022 14:24
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Signed-off-by: Thiago Crepaldi <[email protected]>
Copy link
Contributor

@askhade askhade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@askhade askhade dismissed their stale review August 25, 2022 18:34

Taking request changes back

@gramalingam gramalingam merged commit 68859d3 into onnx:main Aug 29, 2022
@thiagocrepaldi thiagocrepaldi deleted the thiagofc/add-col2im branch September 20, 2022 14:48
liqunfu added a commit to microsoft/onnxruntime that referenced this pull request Jan 25, 2023
**Description**
This PR implements N-dimensional Col2Im as a contrib CPU Op as specified
by ONNX's onnx/onnx#3948

**Motivation and Context**
- Col2Im enables models such as:
  - [SS-DCNet](https://github.com/xhp-hust-2018-2011/SS-DCNet)
  - [DSTT](https://github.com/ruiliu-ai/DSTT)
- It also serves to document the ORT's obscure `math::Col2ImNd` utility

Signed-off-by: Liqun Fu <[email protected]>
Co-authored-by: Liqun Fu <[email protected]>
rui-ren pushed a commit to microsoft/onnxruntime that referenced this pull request Jan 27, 2023
**Description**
This PR implements N-dimensional Col2Im as a contrib CPU Op as specified
by ONNX's onnx/onnx#3948

**Motivation and Context**
- Col2Im enables models such as:
  - [SS-DCNet](https://github.com/xhp-hust-2018-2011/SS-DCNet)
  - [DSTT](https://github.com/ruiliu-ai/DSTT)
- It also serves to document the ORT's obscure `math::Col2ImNd` utility

Signed-off-by: Liqun Fu <[email protected]>
Co-authored-by: Liqun Fu <[email protected]>
broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
* Add Col2Im op to ONNX spec

Signed-off-by: Thiago Crepaldi <[email protected]>

* Fix spec

Signed-off-by: Thiago Crepaldi <[email protected]>

* Address comments

Signed-off-by: Thiago Crepaldi <[email protected]>

* Address comments

Signed-off-by: Thiago Crepaldi <[email protected]>

* Add support to N-dimnesional input

Signed-off-by: Thiago Crepaldi <[email protected]>

* Update to opset 17

Signed-off-by: Thiago Crepaldi <[email protected]>

* Add Col2Im unit test for 5 dim image

Signed-off-by: Thiago Crepaldi <[email protected]>

* Fix style

Signed-off-by: Thiago Crepaldi <[email protected]>

* Address comments

Signed-off-by: Thiago Crepaldi <[email protected]>

* Address comments

Signed-off-by: Thiago Crepaldi <[email protected]>

Signed-off-by: Thiago Crepaldi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: enhancement Request for new feature or operator topic: operator Issues related to ONNX operators
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add col2im operator
5 participants