MCPcopy Create free account
hub / github.com/SafeAILab/EAGLE / custom_sort

Function custom_sort

eagle/model/utils.py:90–95  ·  view source on GitHub ↗
(lst)

Source from the content-addressed store, hash-verified

88
89def generate_tree_buffers(tree_choices, device="cuda"):
90 def custom_sort(lst):
91 # sort_keys=[len(list)]
92 sort_keys = []
93 for i in range(len(lst)):
94 sort_keys.append(lst[i] if lst[i] >= 0 else maxitem)
95 return sort_keys
96 with Timer("sort"):
97
98 sorted_tree_choices = sorted(tree_choices, key=lambda x: (len(x), x))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected