Skip to content

Support doing Dense over n-dimensional (n>1) tensor with 1x1 Conv

Javier Duarte requested to merge github/fork/vloncar/multidim_dense into master

Created by: vloncar

As was discussed before, we currently don't support Dense layer being applied to n-dimensional tensor (with n>1, not counting the batch dimension). This operation is equivalent to doing 1x1 convolution over the same tensor, which we support as a special case. This PR does that by adding an optimizer that replaces Dense with PointwiseConv1D/2D. To support this, converter also had to be extended to properly handle the output shape as well as the Dense layer itself in the hls4ml IR.

Test case can be found here

Merge request reports

Loading