Skip to content
Snippets Groups Projects
Unverified Commit 1e8e2978 authored by auphelia's avatar auphelia Committed by GitHub
Browse files

Merge pull request #735 from Xilinx/hotfix/bp_accumulator_width

[Hotfix] Update minimize accumulator width for bipolar case
parents 10f4630b 4d5e0458
No related branches found
No related tags found
No related merge requests found
......@@ -576,6 +576,10 @@ class MatrixVectorActivation(HLSCustomOp):
def minimize_accumulator_width(self, model):
weights = model.get_initializer(self.onnx_node.input[1])
# since in the calculation the values of the weight matrix are used,
# for the bipolar case they need to be converted to bipolar
if self.get_nodeattr("binaryXnorMode"):
weights = 2 * weights - 1
if len(self.onnx_node.input) > 2:
thresholds = model.get_initializer(self.onnx_node.input[2])
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment