mirror of
https://github.com/open-mmlab/mmpretrain.git
synced 2025-06-03 06:40:40 +08:00
8 lines
211 B
Python
8 lines
211 B
Python
from functools import partial
|
|
|
|
|
|
def multi_apply(func, *args, **kwargs):
|
|
pfunc = partial(func, **kwargs) if kwargs else func
|
|
map_results = map(pfunc, *args)
|
|
return tuple(map(list, zip(*map_results)))
|