TypeTensor - v0.1.0
    Preparing search index...

    Type Alias ReduceShape<InputShape, Axes, KeepDims>

    ReduceShape: KeepDims extends true
        ? ReduceShapeKeepDims<InputShape, Axes>
        : ReduceShapeRemoveDims<InputShape, Axes>

    Compute the output shape after reduction along specified axes

    Type Parameters

    • InputShape extends Shape

      Original tensor shape

    • Axes extends readonly number[]

      Axes to reduce (must be normalized/validated)

    • KeepDims extends boolean = false

      Whether to keep reduced dimensions as size 1

    type Reduced1 = ReduceShape<[2, 3, 4], [1], false> // [2, 4] (remove axis 1)
    type Reduced2 = ReduceShape<[2, 3, 4], [1], true> // [2, 1, 4] (keep axis 1 as size 1)
    type Reduced3 = ReduceShape<[2, 3, 4], [0, 2], false> // [3] (remove axes 0 and 2)