From bae8394bb7bebf61d9b9bd89b3d88605bec77ee9 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Mon, 23 Mar 2020 23:38:21 +0000
Subject: [PATCH] [CustomOp] add dt inference to MaxPoolNHWC, exception for SI

---
 src/finn/custom_op/maxpoolnhwc.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/finn/custom_op/maxpoolnhwc.py b/src/finn/custom_op/maxpoolnhwc.py
index fb21ff9f4..824b37159 100644
--- a/src/finn/custom_op/maxpoolnhwc.py
+++ b/src/finn/custom_op/maxpoolnhwc.py
@@ -40,10 +40,13 @@ class MaxPoolNHWC(CustomOp):
         return {}
 
     def make_shape_compatible_op(self):
-        pass
+        raise Exception("MaxPoolNHWC does not yet support shape inference")
 
     def infer_node_datatype(self, model):
-        pass
+        node = self.onnx_node
+        # data type stays the same
+        dtype = model.get_tensor_datatype(node.input[0])
+        model.set_tensor_datatype(node.output[0], dtype)
 
     def execute_node(self, context, graph):
         node = self.onnx_node
-- 
GitLab