MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / create_loop_block

Function create_loop_block

benchmark/models/scal3r/utils/loop/loop_utils.py:40–48  ·  view source on GitHub ↗
(block: int, target: int)

Source from the content-addressed store, hash-verified

38 return position
39
40 def create_loop_block(block: int, target: int):
41 start, end, num_samples = indices[block][0], indices[block][1], loop_size * 2
42 if target - loop_size < start:
43 end = min(end, start + num_samples)
44 elif target + loop_size > end:
45 start = max(start, end - num_samples)
46 else:
47 start, end = target - loop_size, target + loop_size
48 return start, end
49
50 def overlap(window_a: tuple, window_b: tuple):
51 return max(window_a[0], window_b[0]) < min(window_a[1], window_b[1])

Callers 1

build_loop_batchesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected