• Flattens an arbitrarily nested array.

    const a = [[1, 2], [3, 4], [5, [6, [7]]]];
    const flat = tf.util.flatten(a);
    console.log(flat);

    Type Parameters

    • T extends string | number | boolean | TypedArray | Promise<number>

    Parameters

    • arr: T | RecursiveArray<T>

      The nested array to flatten.

    • Optional result: T[]

      The destination array which holds the elements.

    • Optional skipTypedArray: boolean

      If true, avoids flattening the typed arrays. Defaults to false.

    Returns T[]

    Doc

Generated using TypeDoc