Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

append applied_flows container before filling instead of after #641

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hls4ml/model/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def all_applied_flows():
applied_flows = {}

for flow_group in self._applied_flows:
applied_flows.update({flow: [] for flow in flow_group.keys()})
applied_flows.update({flow: set() for flow in flow_group.keys()})

return applied_flows

Expand All @@ -364,8 +364,8 @@ def all_applied_flows():
if flow in applied_flows:
return

self._apply_sub_flow(flow, applied_flows)
self._applied_flows.append(applied_flows)
self._apply_sub_flow(flow, applied_flows)

def _apply_sub_flow(self, flow_name, applied_flows):
if flow_name in applied_flows:
Expand All @@ -379,7 +379,7 @@ def _apply_sub_flow(self, flow_name, applied_flows):
if len(flow.optimizers) > 0:
applied_passes = optimize_model(self, flow.optimizers)
else:
applied_passes = []
applied_passes = set()
applied_flows[flow.name] = applied_passes

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