Skip to content

Commit

Permalink
more optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
FayazRahman committed Jul 28, 2023
1 parent e3582b1 commit bb372bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions deeplake/util/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ def create_fetching_schedule(dataset, primary_tensor_name, shuffle_within_chunks
if isinstance(index_struct, set):
schedule = [int(idx) for idx in schedule if idx in index_struct]
elif isinstance(index_struct, dict):
nested_schedule = [
[int(idx)] * index_struct[idx] for idx in schedule if idx in index_struct
]
schedule = []
for indexes_list in nested_schedule:
schedule.extend(indexes_list)
idxs = filter(lambda idx: idx in index_struct, schedule)
schedule = [int(idx) for idx in idxs for _ in range(index_struct[idx])]
return schedule


Expand Down

0 comments on commit bb372bf

Please sign in to comment.