Chalkboard - v3.1.0
    Preparing search index...

    Function mulContract

    • Calculates the contraction between paired axes of two tensors. Remaining axes of the first tensor precede those of the second, while two empty axis lists give the outer product.

      Parameters

      • tens1: ChalkboardTensor

        The first tensor

      • tens2: ChalkboardTensor

        The second tensor

      • Optionalaxes1: number | number[]

        Distinct 0-based axes of the first tensor, defaulting to its last axis

      • Optionalaxes2: number | number[] = ...

        Distinct 0-based axes of the second tensor, paired with equal-length axes in axes1

      Returns ChalkboardTensor

      const result = Chalkboard.tens.mulContract([[1, 2], [3, 4]], [[5, 6], [7, 8]]); // Returns [[19, 22], [43, 50]]