Skip to content
Snippets Groups Projects
Commit 65d8322f authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[StreamingFC] ensure 8-bit divisible accums for no-act

parent ae08a914
No related branches found
No related tags found
No related merge requests found
......@@ -483,6 +483,10 @@ class StreamingFCLayer_Batch(HLSCustomOp):
adt = DataType.get_smallest_possible(0 - acc_max)
else:
adt = DataType.get_smallest_possible(acc_max)
# ensure a datatype divisible by 8-bits in case this is the last node
bw = roundup_to_integer_multiple(adt.bitwidth(), 8)
new_adt_name = adt.name.replace(str(adt.bitwidth()), str(bw))
adt = DataType[new_adt_name]
self.set_nodeattr("accDataType", adt.name)
# for no-activation nodes, output dt = acc dt
self.set_nodeattr("outputDataType", adt.name)
......
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