fastmachinelearning / hls4ml

Machine learning on FPGAs using HLS
https://fastmachinelearning.org/hls4ml
Apache License 2.0
1.22k stars 396 forks source link

Use wider accum_t for (average) pooling #681

Closed vloncar closed 1 year ago

vloncar commented 1 year ago

Description

As discussed in 656 io_stream implementation of AveragePooling doesn't use the wider type for summing up the values of the pool window. This fixes it (bugs 1 and 2 from that discussion).

I'd appreciate an expedited review so that we can merge #656 (the test in main branch will fail if we merge that one before this one).

Type of change

Tests

I expanded the test_cnn_mnist.py to include io_stream implementations where this issue was first observed.

Checklist