Remove intermediate casting in product
Created by: jmitrevs
This removes the intermediate casting of scale*x
to a res_T
type in a BatchNormalization
, so casting a res_t
is only of the final scale*x + bias
. I did this by introducing Product_nocast
and mult_nocast
, which multiply and return in the full precision. That seemed easier and less error-prone than manually determining the resulting type in python, and I was hesitant to always make mult and Product return the full precision, though that would be straightforward.
I did confirm that the simple test model is synthesizable with Vivado_HLS 2019.2.
This patch does fix some issues I saw working with low bit values on QONNX.