Skip to content

Commit

Permalink
Merge pull request #142 from weiya711/unroll_bug_fix
Browse files Browse the repository at this point in the history
fix bug handling sam graphs without consectuive numbered nodes
  • Loading branch information
kalhankoul96 authored Aug 12, 2024
2 parents e7a5129 + bac356a commit 47895d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sam/onyx/parse_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,13 @@ def duplicate_graph(self, unroll_factor):

dupe_map = {}
orig_nodes_list = self.graph.get_nodes().copy() # shallow copy is sufficient
node_count = len(orig_nodes_list)
# get largest node number
node_count = 0
for node in orig_nodes_list:
node_name = node.get_name().strip('"')
if int(node_name) > node_count:
node_count = int(node_name)
node_count += 1
# Duplicate every node that isn't the tensor of interest
for node in orig_nodes_list:
node_attrs = node.get_attributes()
Expand Down

0 comments on commit 47895d2

Please sign in to comment.