Skip to content
Snippets Groups Projects
Unverified Commit d44ec2d4 authored by Yaman Umuroglu's avatar Yaman Umuroglu Committed by GitHub
Browse files

[AddStreams] check PE constr + future odt comment

parent 9eb49b65
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ class AddStreams_Batch(HLSCustomOp):
def get_folded_input_shape(self):
ich = self.get_nodeattr("NumChannels")
pe = self.get_nodeattr("PE")
assert ich % pe == 0, "PE must divide NumChannels"
vecs = list(self.get_nodeattr("numInputVectors"))
ishape = tuple(vecs + [ich // pe, pe])
return ishape
......@@ -144,6 +145,8 @@ class AddStreams_Batch(HLSCustomOp):
def get_output_datatype(self):
"""Returns FINN DataType of output."""
# we need to set output datatype to the next larger int or uint
# enhancement: consider specifying w/ explicit outputDataType attribute
# to allow overflow and use the same idt if user wants
idt = DataType[self.get_nodeattr("inputDataType")]
if idt.signed():
return DataType.get_smallest_possible(2 * idt.min())
......
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