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 Scan type/shape inferencing #1503

Merged
merged 40 commits into from
Oct 31, 2018

Conversation

skottmckay
Copy link
Contributor

Add TypeAndShapeInferenceFunction for Scan

@gramalingam
Copy link
Contributor

With the introduction of control-flow ops, we need to extend the InferenceContext to enable recursive shape-inference for sub-graphs of control-flow ops. @houseroad @bddppq @linkerzhang can you please take a look at the extension to the InferenceContext API in this PR for this purpose?

- Validate types match the Scan constraints.
- Fix a consistency issue in shape_inference.h where a couple of methods were using int instead of size_t.
@gramalingam
Copy link
Contributor

Hi @anderspapitto @linkerzhang : any feedback on the extension to InferenceContext api?

gramalingam and others added 16 commits October 23, 2018 15:39
…for a sub-graph represented by a GraphProto attribute in the current node.

Split out from PR 1503 which also adds type/shape inferencing for the sub-graph in the Scan operator.
… a separate interface.

Update ONNX level implementation to enable graph inferencing for GraphProto attributes in nodes.
Merge in some changes to subgraph inferencing structure.
Fix some const-ness issues.
Make naming more consistent.
@skottmckay
Copy link
Contributor Author

Updated with changes from PR to separate InferenceContext changes out. #1548

@linkerzhang
Copy link
Member

Thank you very much!

@linkerzhang linkerzhang merged commit 882c528 into onnx:master Oct 31, 2018
@skottmckay skottmckay deleted the AddScanShapeInferencing branch February 27, 2019 20:43
hariharans29 pushed a commit to hariharans29/onnx that referenced this pull request Aug 15, 2019
* Add Scan type/shape inferencing.
Add helper to merge two shapes.

* Tweak doco a little.

* Add hook to InferenceContext for subgraph inferencing.

* Address PR comment

* Address PR comments.

- Validate types match the Scan constraints.
- Fix a consistency issue in shape_inference.h where a couple of methods were using int instead of size_t.

* Use RepeatedPtrField::Get instead of operator[] for compatibility with protobuf v2.6

* Update Scan inferencing to use RepeatedPtrField::Get instead of operator[] for compatibility with protobuf 2.6.

* Add hook to InferenceContext to allow running type/shape inferencing for a sub-graph represented by a GraphProto attribute in the current node.

Split out from PR 1503 which also adds type/shape inferencing for the sub-graph in the Scan operator.

* Re-work the setup a little to abstract out the graph inferencing into a separate interface.

Update ONNX level implementation to enable graph inferencing for GraphProto attributes in nodes.

* Add #include <memory> for linux build

* Use stl_backports.h for make_unique

* Fix some linux build issues.

* Fix linux C++11 build issue.

* Update to new subgraph inferencing structure.

* Add inputData to inferencing API.
Fix some const-ness issues.
Make naming more consistent.

* Update to pass input data to subgraph inferencing.

* Trigger

* Trigger build

* Trigger

* Add unit test for GraphInferencer that checks direct subgraph inferencing, and subgraph inferencing when contained in a Scan node.

* Save with debug setup

* Add python test for Scan shape inferencing.

* Add #type annotation

* Fix whitespace in py file.
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Add Scan type/shape inferencing.
Add helper to merge two shapes.

* Tweak doco a little.

* Add hook to InferenceContext for subgraph inferencing.

* Address PR comment

* Address PR comments.

- Validate types match the Scan constraints.
- Fix a consistency issue in shape_inference.h where a couple of methods were using int instead of size_t.

* Use RepeatedPtrField::Get instead of operator[] for compatibility with protobuf v2.6

* Update Scan inferencing to use RepeatedPtrField::Get instead of operator[] for compatibility with protobuf 2.6.

* Add hook to InferenceContext to allow running type/shape inferencing for a sub-graph represented by a GraphProto attribute in the current node.

Split out from PR 1503 which also adds type/shape inferencing for the sub-graph in the Scan operator.

* Re-work the setup a little to abstract out the graph inferencing into a separate interface.

Update ONNX level implementation to enable graph inferencing for GraphProto attributes in nodes.

* Add #include <memory> for linux build

* Use stl_backports.h for make_unique

* Fix some linux build issues.

* Fix linux C++11 build issue.

* Update to new subgraph inferencing structure.

* Add inputData to inferencing API.
Fix some const-ness issues.
Make naming more consistent.

* Update to pass input data to subgraph inferencing.

* Trigger

* Trigger build

* Trigger

* Add unit test for GraphInferencer that checks direct subgraph inferencing, and subgraph inferencing when contained in a Scan node.

* Save with debug setup

* Add python test for Scan shape inferencing.

* Add #type annotation

* Fix whitespace in py file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants