Skip to content

Commit

Permalink
make predict a little bit faster (aimclub#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakonick authored Oct 25, 2023
1 parent 56c9c58 commit 13742c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bamt/networks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,12 @@ def wrapper():
output[node.name] = node.choose(node_data, pvals=pvals)
return output

if progress_bar:
if predict:
seq = []
for _ in tqdm(range(n), position=0, leave=True):
result = wrapper()
seq.append(result)
elif progress_bar:
seq = Parallel(n_jobs=parall_count)(
delayed(wrapper)() for _ in tqdm(range(n), position=0, leave=True)
)
Expand Down

0 comments on commit 13742c5

Please sign in to comment.