diff --git a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py index 0ac85daba2424df9d8f87dcaa96dfc1a46a1acb0..ce5a0fb3a18eb16952f98362ffffa0e0adf7e3e4 100644 --- a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py +++ b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py @@ -166,7 +166,10 @@ class StreamingFCLayer_Batch(HLSCustomOp): inp_is_bipolar = inp_is_bipolar or (inp_is_binary and bin_xnor_mode) wt_is_bipolar = wt_is_bipolar or (wt_is_binary and bin_xnor_mode) if inp_is_bipolar and wt_is_bipolar: + # ensure all thresholds are nonnegative assert (orig_thres_matrix >= 0).all() + # ensure all thresholds are integer + assert (orig_thres_matrix.astype(np.int32) == orig_thres_matrix).all() ret = orig_thres_matrix # ensure channels = mh , duplicating if necessary if ret.shape[0] == 1: