閱碼場AIKit人工智能項(xiàng)目實(shí)戰(zhàn) - TensorFlow篇
public class ArraySumForForkJoinPool {
? ?public static int sumParallel(int[] array) throws ExecutionException, InterruptedException {
? ? ? ?ForkJoinPool pool = new ForkJoinPool();
? ? ? ?return pool.submit(new SubArraySum(array, 0, array.length - 1)).get();
? ?}
? ?public static void main(String[] args) throws ExecutionException, InterruptedException {
? ? ? ?System.out.println(sumParallel(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9}));
? ?}
標(biāo)簽: