TypeTensor - v0.1.0
    Preparing search index...

    Type Alias MatmulOp<A, B>

    MatmulOp: IsMatMulCompatible<A["__shape"], B["__shape"]> extends true
        ? MatMulShape<A["__shape"], B["__shape"]> extends never
            ? never
            : StorageTransformation<
                "matmul",
                TensorStorage<
                    Promote<A["__dtype"], B["__dtype"]>,
                    MatMulShape<A["__shape"], B["__shape"]>,
                    ComputeStrides<MatMulShape<A["__shape"], B["__shape"]>>,
                    MatmulOpLayout,
                >,
                readonly [A, B],
            >
        : never

    Matrix multiplication operation with shape validation

    This type performs compile-time validation that:

    1. Both inputs are at least 1D
    2. Inner dimensions match (A's last dim == B's second-to-last dim)
    3. Batch dimensions are compatible

    The output shape follows NumPy/PyTorch conventions:

    • 1D × 1D → scalar
    • 1D × 2D → 1D
    • 2D × 1D → 1D
    • 2D × 2D → 2D
    • ND × ND → ND with broadcasted batch dimensions

    Type Parameters