From db15c3c954d20e1e5a86d1a4ed530e43dffa130d Mon Sep 17 00:00:00 2001
From: Hashim Sharif <hsharif3@tyler.cs.illinois.edu>
Date: Mon, 18 May 2020 02:01:05 -0500
Subject: [PATCH] Fxing op file construction script

---
 .../soc_simulator/scripts/construct_ops.py         | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/llvm/projects/soc_simulator/scripts/construct_ops.py b/llvm/projects/soc_simulator/scripts/construct_ops.py
index 3b655f2f5f..3bcb2af9c3 100644
--- a/llvm/projects/soc_simulator/scripts/construct_ops.py
+++ b/llvm/projects/soc_simulator/scripts/construct_ops.py
@@ -11,7 +11,7 @@ op_map["pool"] = "Pool"
 op_map["relu"] = "Relu"
 op_map["activation"] = "Relu"
 op_map["tanh"] = "Tanh"
-op_map["batchnorm"] = "NML"
+op_map["batchnorm"] = "BatchNorm"
 
 
 unique_op_map = {}
@@ -45,19 +45,29 @@ if __name__ == "__main__":
   f2 = open(out_path, "w+")
 
 
-
   nml_id = 1
   conv_id = 1
   fc_id = 1
+  batchnorm_id = 1
   
   for x in f:
       toks = x.split()
 
       layer_len = len(toks)
 
+      #if "batchnorm" in toks:
+      #    f2.write("BatchNorm" + str(batchnorm_id) + "\n")
+      #    batchnorm_id += 1
+      #    continue
+      
       if layer_len == 1 and "conv" not in toks and "dense" not in toks:
           f2.write("#NML" + str(nml_id) + ",1\n")
           nml_id += 1
+
+          layer_str = getLayerStr(toks)
+          f2.write(layer_str)
+      
+          
       if "conv" in toks:
           f2.write("#Conv" + str(conv_id) + "," + str(layer_len) + "\n")
 
-- 
GitLab