mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
9 lines
259 B
Python
9 lines
259 B
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
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)))
|