From d42fe72a6ff2ed4eb848e089b4e24685e4d4a5ae Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Wed, 19 Feb 2020 22:48:22 +0000
Subject: [PATCH] [TLastMarker] add basic passthru execution

---
 src/finn/custom_op/fpgadataflow/tlastmarker.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/finn/custom_op/fpgadataflow/tlastmarker.py b/src/finn/custom_op/fpgadataflow/tlastmarker.py
index 9a3721790..3f3bf6e79 100644
--- a/src/finn/custom_op/fpgadataflow/tlastmarker.py
+++ b/src/finn/custom_op/fpgadataflow/tlastmarker.py
@@ -17,8 +17,15 @@ class TLastMarker(HLSCustomOp):
         return my_attrs
 
     def execute_node(self, context, graph):
-        # TODO consider implementing rtlsim for TLastMarker
-        raise Exception("TLastMarker does yet not support execution")
+        # TLastMarker's behavior is only visible when doing
+        # rtlsim with stitched IP, since it marks the end
+        # of the current image/input sample. when executing
+        # inside FINN as a single node, this is not visible.
+        # so here we simply return the input as output
+        i_name = self.onnx_node.input[0]
+        o_name = self.onnx_node.output[0]
+        i_tensor = context[i_name]
+        context[o_name] = i_tensor
 
     def make_shape_compatible_op(self):
         # not supported for shape inference
-- 
GitLab