From fb8f3e4bd1462791a0680a50b459281bebdd0340 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Mon, 18 May 2020 16:05:23 +0100
Subject: [PATCH] [LabelSel] use UINT32 in dtype inference

---
 src/finn/custom_op/fpgadataflow/labelselect_batch.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/finn/custom_op/fpgadataflow/labelselect_batch.py b/src/finn/custom_op/fpgadataflow/labelselect_batch.py
index 42821a067..dffcc40a7 100644
--- a/src/finn/custom_op/fpgadataflow/labelselect_batch.py
+++ b/src/finn/custom_op/fpgadataflow/labelselect_batch.py
@@ -105,7 +105,9 @@ class LabelSelect_Batch(HLSCustomOp):
         )
 
     def infer_node_datatype(self, model):
-        model.set_tensor_datatype(self.onnx_node.output[0], DataType.INT64)
+        # currently set to uint32 to be compatible with hlslib
+        # enhancement: consider finding smallest power-of-two int for reduced output bandwidth
+        model.set_tensor_datatype(self.onnx_node.output[0], DataType.UINT32)
 
     def verify_node(self):
         info_messages = []
-- 
GitLab