Symbolic shape inference support-2: data propagation-1#3551
Symbolic shape inference support-2: data propagation-1#3551askhade merged 70 commits intoonnx:masterfrom
Conversation
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
| } | ||
| } | ||
|
|
||
| inline void ShapeDataPropagator(DataPropagationContext& ctx) { |
There was a problem hiding this comment.
what is the purpose of this function?
There was a problem hiding this comment.
after reading the rest of the PR now I understand this is the data propagator for shape op... Please update the function name to make it more clear and add some comments
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
… jcw/symbolic-2
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
… jcw/symbolic-2
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
| agraph (int32[2,5] x) => (int32[2,5] z) | ||
| { | ||
| y = Shape(x) | ||
| z = Cast(y) |
There was a problem hiding this comment.
I think "Cast" must specify the target of Cast, like "Cast<to = ...>(y)"
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
| agraph (int32[2,5] x) => (int32[2,5] w) | ||
| { | ||
| y = Shape(x) | ||
| z = Unsqueeze(y) |
There was a problem hiding this comment.
Adding required input "axes" for Unsqueeze
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
| z = Unsqueeze(y) | ||
| w = Cast(z) | ||
| z = Shape(x) | ||
| w = Unsqueeze(z, y) |
There was a problem hiding this comment.
I think we can make y a constant as y = Constant <...>() to test this out.
There was a problem hiding this comment.
Of course, that would require a data-propagation for Constant. May be that is the issue (until we allow initializers in the parser).
There was a problem hiding this comment.
Added. Since the data propagation of Unsqueeze won't use axes, not sure whether Constant works as expected in this case.
Of course, that would require a data-propagation for Constant. May be that is the issue (until we allow initializers in the parser).
Actually I think we can just skip Constant for data propagation? Constant data can still go into inputDataByName for other op's data propagation function to use, right?
There was a problem hiding this comment.
You are right, my mistake, sorry. Please ignore my comment.
There was a problem hiding this comment.
I mean it is not required for Unsqueeze
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
|
Unfortunately code from this change breaks building on older compilers (break occurs on CentOS 7.6) |
@postrational Do you have detailed errors that I can look into? Thanks! |
Description
Introduce DataPropagationContext, PartialDataPropagationFunction
Implement selected operators for PartialDataPropagationFunction as below:
Add tests
TODO in another PR:
Add, Concat, Gather, Mul, Reshape, Slice, Size
Motivation and Context
#3506 Second step of symbolic shape inference: partial data propagation