我的代码:
for batchList in all_List:
result = getBatch_filter(batchList, entTotal, tripleList, neg_rate)
def getBatch_filter(batchList, entTotal, tripleList, neg_rate):
result = []
for item in batchList:
a = corrupt_a(item, entTotal, tripleList, neg_rate)
b = corrupt_b(item, entTotal, tripleList, neg_rate)
result += a
result += b
return result
其中,batchList、a、b是嵌套列表,如:[[1,2,3],[3,4,1,4,6],[6,9,10,11]...]
我想对函数getBatch_filter
中的for
循环进行多处理。我尝试了Pool,但它运行整个文件而不是函数。任何帮助都将不胜感激
请参见此示例:
因此,在您的情况下,您将执行以下操作:
相关问题 更多 >
编程相关推荐