• Creates a new tensor by applying sparse updates to individual values or slices within a zero tensor of the given shape tensor according to indices. This operator is the inverse of the tf.gatherND operator which extracts values or slices from a given tensor.

    const indices = tf.tensor2d([4, 3, 1, 7], [4, 1], 'int32');
    const updates = tf.tensor1d([9, 10, 11, 12]);
    const shape = [8];
    tf.scatterND(indices, updates, shape).print() //[0, 11, 0, 10, 9, 0, 0, 12]

    Type Parameters

    • R extends Rank

    Parameters

    Returns Tensor<R>

    Doc

Generated using TypeDoc