You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TOSA: concat: fix canonicalization that would result in concat with no operands
The fold() of the concat had two issues:
a) It would fold `concat (tensor<0x2>, tensor<0x4>), axis=1 -> tensor<0x6>` into `concat ()` (no operands)
based on the observation that both operands have zero elements. This is invalid as concat needs to have
at least one operand.
b) After that fix, it would fold `concat (tensor<0x2>, tensor<0x4>), axis=1 -> tensor<0x6>`
int `concat (tensor<0x4>), axis=1 -> tensor<0x6>`. This is also invalid; even though the concat
still produces the same number of elements (= none), shape relations are not corret (0x4 input, but 0x6 output).
I fixed that by only removing operands from the concat when
- the operand has zero dim on the concatenation axis (i.e. it doesn't contribute to the result shape)
- there is at least one operand left after removing
0 commit comments