Skip to content

Commit

Permalink
Update graph_rewriter.py (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayzwer authored Jun 20, 2024
1 parent 83708b8 commit 860ca7f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions onnxslim/core/graph_rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ def get_node_feeds(node):
feeds.append(input)
else:
for feed in input.inputs:
if feed.op == "Split":
feeds.append(input)
else:
feeds.append(feed)
feeds.append(input if feed.op == "Split" else feed)
return feeds


def get_name(name):
_illegal_char_regex = re.compile("[^0-9a-zA-Z_]+")
sanitized_name = _illegal_char_regex.sub("_", name)
if sanitized_name.isdigit():
sanitized_name = "_" + sanitized_name
sanitized_name = f"_{sanitized_name}"

return sanitized_name

Expand Down

0 comments on commit 860ca7f

Please sign in to comment.