• Returns the indices of the maximum values along an axis.

    The result has the same shape as input with the dimension along axis removed.

    const x = tf.tensor1d([1, 2, 3]);

    x.argMax().print(); // or tf.argMax(x)
    const x = tf.tensor2d([1, 2, 4, 3], [2, 2]);

    const axis = 1;
    x.argMax(axis).print(); // or tf.argMax(x, axis)

    Type Parameters

    Parameters

    • x: Tensor<Rank> | TensorLike

      The input tensor.

    • Optional axis: number

      The dimension to reduce. Defaults to 0 (outer-most dimension).

    Returns T

    Doc

Generated using TypeDoc