executor.map和命名参数传递

时间:2017-09-03 23:50:24

标签: python concurrency iterator future map-function

我有一个必须使用大量参数类型运行的函数

# generic function with named parameters
def genericFn(X, y, a_fn ='t', o_fn ='a', l_fn='b', dim=2):
   ...
  return accuracy

我有一个参数类型列表

a_fns = ['t', 's', 'r', 'l']
o_fns = ['s', 'a']
l_fns = ['m', 'h', 'l', 'b', 'k', 'p']

如何将所有可能的功能组合传递给池

with concurrent.futures.ProcessPoolExecutor() as executor:
  results_list = executor.map(genericFn, (combinations of named parameters))

0 个答案:

没有答案