mirror of
https://github.com/open-mmlab/mmpretrain.git
synced 2025-06-03 14:59:18 +08:00
10 lines
243 B
Python
10 lines
243 B
Python
from functools import partial
|
|
|
|
from six.moves import map, zip
|
|
|
|
|
|
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)))
|