Skip to content

Commit

Permalink
fix bug handling sam graphs without consectuive numbered nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kalhankoul96 committed Aug 12, 2024
1 parent e7a5129 commit df121ca
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 df121ca

Please sign in to comment.