Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TOSA: concat: fix canonicalization that would result in concat with n…
…o 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
- Loading branch information