MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / __init__

Method __init__

test/general/lm_eval/utils.py:203–210  ·  view source on GitHub ↗
(self, arr, fn)

Source from the content-addressed store, hash-verified

201
202class Reorderer:
203 def __init__(self, arr, fn):
204 self.size = len(arr)
205 arr = list(enumerate(arr))
206 arr = group(arr, lambda x: fn(x[1]))
207 arr = [([y[0] for y in x], x[0][1]) for x in arr]
208 arr.sort(key=lambda x: fn(x[1]))
209
210 self.arr = arr
211
212 def get_reordered(self):
213 return [x[1] for x in self.arr]

Callers

nothing calls this directly

Calls 1

groupFunction · 0.85

Tested by

no test coverage detected