forked from tangger/lerobot
remove power of 2 optimization
This commit is contained in:
@@ -72,14 +72,11 @@ class SumTree:
|
|||||||
def __init__(self, capacity: int):
|
def __init__(self, capacity: int):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
capacity: Maximum number of elements. The tree size is the next power of 2 for efficiency.
|
capacity: Maximum number of elements.
|
||||||
"""
|
"""
|
||||||
self.capacity = capacity
|
self.capacity = capacity
|
||||||
self.size = 1
|
self.size = capacity
|
||||||
while self.size < capacity:
|
self.tree = [0.0] * (2 * self.size)
|
||||||
self.size *= 2 # Ensure power-of-two size for efficient updates
|
|
||||||
|
|
||||||
self.tree = [0.0] * (2 * self.size) # Tree structure
|
|
||||||
|
|
||||||
def initialize_tree(self, priorities: List[float]):
|
def initialize_tree(self, priorities: List[float]):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user