Skip to content

Commit 1413c03

Browse files
jmitrevsvloncar
authored andcommitted
append applied_flows container before filling instead of after (and be consistent using empty sets intead of lists)
1 parent 0d1bc8b commit 1413c03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hls4ml/model/graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def all_applied_flows():
348348
applied_flows = {}
349349

350350
for flow_group in self._applied_flows:
351-
applied_flows.update({flow: [] for flow in flow_group.keys()})
351+
applied_flows.update({flow: set() for flow in flow_group.keys()})
352352

353353
return applied_flows
354354

@@ -364,8 +364,8 @@ def all_applied_flows():
364364
if flow in applied_flows:
365365
return
366366

367-
self._apply_sub_flow(flow, applied_flows)
368367
self._applied_flows.append(applied_flows)
368+
self._apply_sub_flow(flow, applied_flows)
369369

370370
def _apply_sub_flow(self, flow_name, applied_flows):
371371
if flow_name in applied_flows:
@@ -379,7 +379,7 @@ def _apply_sub_flow(self, flow_name, applied_flows):
379379
if len(flow.optimizers) > 0:
380380
applied_passes = optimize_model(self, flow.optimizers)
381381
else:
382-
applied_passes = []
382+
applied_passes = set()
383383
applied_flows[flow.name] = applied_passes
384384

385385
def make_node(self, kind, name, attributes, inputs, outputs=None):

0 commit comments

Comments
 (0)