TypeTensor - v0.1.0
    Preparing search index...

    Type Alias BroadcastShapes<A, B>

    BroadcastShapes: BroadcastReversed<Reverse<A>, Reverse<B>, A, B> extends infer Result
        ? Result extends Shape ? Reverse<Result> : IncompatibleShapes<A, B>
        : IncompatibleShapes<A, B>

    Compute the resulting shape when broadcasting two shapes Returns IncompatibleShapes (a special never type) if shapes are incompatible

    Type Parameters

    type Result = BroadcastShapes<[1, 3], [2, 1]> // [2, 3]
    type Error = BroadcastShapes<[2, 3], [3, 2]> // IncompatibleShapes<[2, 3], [3, 2]>