• Computes the cumulative sum of a tf.Tensor along axis.

    const x = tf.tensor([1, 2, 3, 4]);
    x.cumsum().print();
    const x = tf.tensor([[1, 2], [3, 4]]);
    x.cumsum().print();

    Type Parameters

    Parameters

    • x: Tensor<Rank> | TensorLike

      The input tensor to be summed.

    • Optional axis: number

      The axis along which to sum. Optional. Defaults to 0.

    • Optional exclusive: boolean

      Whether to perform exclusive cumulative sum. Optional. Defaults to false. If set to true then the sum of each tensor entry does not include its own value, but only the values previous to it along the specified axis.

    • Optional reverse: boolean

      Whether to sum in the opposite direction. Optional. Defaults to false.

    Returns T

    Doc

Generated using TypeDoc