-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
Add helper to merge two shapes.
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.
…tor[] for compatibility with protobuf 2.6.
Hi @anderspapitto @linkerzhang : any feedback on the extension to InferenceContext api? |
…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.
…apeInferencingForGraphProtoAttributes
… of https://github.com/skottmckay/onnx into EnableRecursiveShapeInferencingForGraphProtoAttributes
…apeInferencingForGraphProtoAttributes
… a separate interface. Update ONNX level implementation to enable graph inferencing for GraphProto attributes in nodes.
…apeInferencingForGraphProtoAttributes
…apeInferencingForGraphProtoAttributes
Merge in some changes to subgraph inferencing structure.
Fix some const-ness issues. Make naming more consistent.
…apeInferencingForGraphProtoAttributes
… of https://github.com/skottmckay/onnx into EnableRecursiveShapeInferencingForGraphProtoAttributes
… into AddScanShapeInferencing
…ay/onnx into AddScanShapeInferencing
Updated with changes from PR to separate InferenceContext changes out. #1548 |
…cing, and subgraph inferencing when contained in a Scan node.
Thank you very much! |
* 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.
* 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.
Add TypeAndShapeInferenceFunction for Scan