Reshape fixes: don't repack stream for flatten; remove final reshape
2 reshape-related fixes:
- Fix to
ReshapeStream
optimizer: don't repack stream for flatten; Addresses #408 (closed)- Resources for TinyML model are consistent with skipping optimizer:
+-----------------+---------+-------+--------+-------+-----+
| Name | BRAM_18K| DSP48E| FF | LUT | URAM|
+-----------------+---------+-------+--------+-------+-----+
|DSP | -| -| -| -| -|
|Expression | -| -| 0| 2| -|
|FIFO | 163| -| 6241| 13136| -|
|Instance | 99| 0| 30015| 34856| 0|
|Memory | -| -| -| -| -|
|Multiplexer | -| -| -| 9| -|
|Register | -| -| 1| -| -|
+-----------------+---------+-------+--------+-------+-----+
|Total | 262| 0| 36257| 48003| 0|
+-----------------+---------+-------+--------+-------+-----+
|Available | 280| 220| 106400| 53200| 0|
+-----------------+---------+-------+--------+-------+-----+
|Utilization (%) | 93| 0| 34| 90| 0|
+-----------------+---------+-------+--------+-------+-----+
- Introduce
RemoveFinalReshape
optimizer to remove reshape if it's the final layer; Addresses #415 (closed)- Currently, this is in the same file
repack_stream.py
, but it could be moved - This script now works out of the box: https://gist.github.com/jmduarte/4c91f28ab570036aa4cef63db0eb2322
- Should we add a pytest similar to the above script?
- Currently, this is in the same file