Skip to content

Commit

Permalink
增加并行转化
Browse files Browse the repository at this point in the history
  • Loading branch information
fangwei123456 committed Sep 10, 2020
1 parent 013939a commit 8fbb4c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spikingjelly/datasets/dvs_gesture.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,16 @@ def cvt_files_fun(aedat_file_list):
thread_list = []
for i in range(7):
thread_list.append(spikingjelly.datasets.FunctionThread(cvt_files_fun, aedat_files[i * block, (i + 1) * block]))

print('thread {i} start')
thread_list[-1].start()
# 最后一段任务由主线程完成
print('thread {7} start')
for aedat_file in tqdm.tqdm(aedat_files[7 * block:]):
cvt_file_fun(aedat_file)
print('thread {7} finished')
for i in range(thread_list.__len__()):
thread_list[i].join()
print(f'thread {i} finished')



Expand Down

0 comments on commit 8fbb4c8

Please sign in to comment.