When the number of elements of two shapes are not equal, a Reshape operation cannot be used to transfer one into another
Function findIntermediateShape(...) can cause out-of-boundaries operator[] call if the abovementioned condition strikes
The test-case I used now causes no error as its root-cause was an issue in Tosa dialect with padded Conv2D operations lowering which is already solved in commit 69c984b6
Generally it is ill advised to mutate and compare in a single if condition, especially with pre/post incrementations. It should be good enough to do the following:
Overall this is simpler and the extra break is not that beneficial.