TypeTensor - v0.1.0
    Preparing search index...

    Type Alias MaxOp<Input, Axes, KeepDims, OutputDType>

    MaxOp: ValidateReduction<Input["__shape"], Axes> extends true
        ? StorageTransformation<
            "max",
            TensorStorage<
                OutputDType,
                ComputeReductionShape<Input["__shape"], Axes, KeepDims>,
                ComputeStrides<ComputeReductionShape<Input["__shape"], Axes, KeepDims>>,
                ReductionOpLayout<Input["__layout"]>,
            >,
            readonly [Input],
        > & { __keepDims: KeepDims; __maxAxes: Axes }
        : never

    Max reduction operation Computes the maximum of tensor elements along specified axes

    Type Parameters

    • Input extends AnyTensorStorage

      Input tensor storage type

    • Axes extends readonly number[] | undefined

      Axes to reduce along (undefined means reduce all)

    • KeepDims extends boolean = false

      Whether to keep reduced dimensions as size 1

    • OutputDType extends AnyDType = Input["__dtype"]

      Output data type (defaults to same as input)

    // Max along axis 1, remove dimension
    type Input = TensorStorage<Float32, [2, 3, 4], [12, 4, 1], DefaultLayoutFlags>;
    type Result = MaxOp<Input, [1], false>; // Shape: [2, 4]
    // Global max (all elements)
    type GlobalMax = MaxOp<Input, undefined, false>; // Shape: []