diff --git a/src/finn/backend/fpgadataflow/code_gen.py b/src/finn/backend/fpgadataflow/code_gen.py index f0cf4bdf2cd7622756266db0acbeaee28e8753bc..f0ecd63a6d655e59760f732c327c64c283db81b7 100644 --- a/src/finn/backend/fpgadataflow/code_gen.py +++ b/src/finn/backend/fpgadataflow/code_gen.py @@ -56,7 +56,7 @@ def strm_prgm(model, code_gen_dict): def computation_cmds(all_strmfcl, code_gen_dict): code_gen_dict["compute"] = [] for i in range(len(all_strmfcl)): - if i == (len(all_strmfcl)-1): + if i == (len(all_strmfcl) - 1): code_gen_dict["compute"].append( "{}<L{}_MW, L{}_MH, L{}_SIMD, L{}_PE, {}> " "({}, {}, {}, {}, numReps, {});".format( @@ -84,7 +84,7 @@ def computation_cmds(all_strmfcl, code_gen_dict): i, all_strmfcl[i].resDataType, all_strmfcl[i].input, - all_strmfcl[i+1].input, + all_strmfcl[i + 1].input, all_strmfcl[i].weights, all_strmfcl[i].thresholds, all_strmfcl[i].resType, @@ -92,7 +92,6 @@ def computation_cmds(all_strmfcl, code_gen_dict): ) - def config_cmds(model, code_gen_dict): all_strmfcl = [] code_gen_dict["config"] = [] @@ -143,6 +142,7 @@ def config_cmds(model, code_gen_dict): all_strmfcl.append(layer) return all_strmfcl + def code_generation(model): code_gen_dict = {} diff --git a/src/finn/backend/fpgadataflow/layers.py b/src/finn/backend/fpgadataflow/layers.py index b3ee23ca7b9597a9f5a2e5109085792978667080..7bd9adc6c5866278f21ddfc66825e6f20c4594c5 100644 --- a/src/finn/backend/fpgadataflow/layers.py +++ b/src/finn/backend/fpgadataflow/layers.py @@ -1,6 +1,6 @@ class StreamingFCLayer_Batch: def __init__(self, node, model): - self.op_type = 'StreamingFCLayer_Batch' + self.op_type = "StreamingFCLayer_Batch" # Layer attributes num_attr = len(node.attribute) for k in range(num_attr):