From 3f260f6b8ceece2f841657656f6fe5354376e5ad Mon Sep 17 00:00:00 2001
From: auphelia <jakobapk@web.de>
Date: Wed, 11 Dec 2019 15:23:20 +0000
Subject: [PATCH] [member function] Changed get_nodeattr_types by moving
 "backend" attribute to __init__ instead of in each fpgadataflow custom op
 class

---
 src/finn/custom_op/fpgadataflow/__init__.py               | 6 +++++-
 src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py | 6 +++---
 src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py | 6 +++---
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/finn/custom_op/fpgadataflow/__init__.py b/src/finn/custom_op/fpgadataflow/__init__.py
index 0160c5f02..6a37519d3 100644
--- a/src/finn/custom_op/fpgadataflow/__init__.py
+++ b/src/finn/custom_op/fpgadataflow/__init__.py
@@ -40,7 +40,11 @@ class HLSCustomOp(CustomOp):
         self.code_gen_dict = {}
 
     def get_nodeattr_types(self):
-        return {"code_gen_dir": ("s", False, ""), "executable_path": ("s", False, "")}
+        return {
+            "backend": ("s", True, "fpgadataflow"),
+            "code_gen_dir": ("s", False, ""),
+            "executable_path": ("s", False, ""),
+        }
 
     def code_generation(self, model):
         node = self.onnx_node
diff --git a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
index 0e6469431..975da666f 100644
--- a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
+++ b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
@@ -14,9 +14,9 @@ class StreamingFCLayer_Batch(HLSCustomOp):
 
     def get_nodeattr_types(self):
         my_attrs = {
-            "backend": ("s", True, "fpgadataflow"),
-            "code_gen_dir": ("s", True, ""),
-            "executable_path": ("s", True, ""),
+            # "backend": ("s", True, "fpgadataflow"),
+            # "code_gen_dir": ("s", True, ""),
+            # "executable_path": ("s", True, ""),
             "PE": ("i", True, 0),
             "SIMD": ("i", True, 0),
             "MW": ("i", True, 0),
diff --git a/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py b/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py
index 5e90d37e6..92f499b67 100644
--- a/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py
+++ b/src/finn/custom_op/fpgadataflow/streamingmaxpool_batch.py
@@ -4,9 +4,9 @@ from finn.custom_op.fpgadataflow import HLSCustomOp
 class StreamingMaxPool_Batch(HLSCustomOp):
     def get_nodeattr_types(self):
         my_attrs = {
-            "backend": ("s", True, "fpgadataflow"),
-            "code_gen_dir": ("s", True, ""),
-            "executable_path": ("s", True, ""),
+            # "backend": ("s", True, "fpgadataflow"),
+            # "code_gen_dir": ("s", True, ""),
+            # "executable_path": ("s", True, ""),
             "ImgDim": ("i", True, 0),
             "PoolDim": ("i", True, 0),
             "NumChannels": ("i", True, 0),
-- 
GitLab