Skip to content

Commit

Permalink
fix: add missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
marty1885 committed Mar 26, 2024
1 parent bfb723a commit e24fb2a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5872,6 +5872,18 @@ def export_c_graph(location, graph):
with open(f"{fname}", "w") as f:
f.write(str(graph))

def _binray_search(lst, func):
"""Binary search for the first index that func returns True"""
l, r = 0, len(lst)
while l < r:
m = (l + r) // 2
if func(lst[m]):
r = m
else:
l = m + 1
return l


def outplace_inplace_ops(opnodes):

replace_map = []
Expand Down

0 comments on commit e24fb2a

Please sign in to comment.