Chalkboard - v3.1.0
    Preparing search index...

    Function mulHadamard

    • Calculates the Hadamard (elementwise) product of two tensors, which are broadcast together as in NumPy (their shapes are aligned from the right, and axes of length 1 or missing axes are stretched).

      Parameters

      Returns ChalkboardTensor

      const result = Chalkboard.tens.mulHadamard([[1, 2], [3, 4]], [[5, 6], [7, 8]]); // Returns [[5, 12], [21, 32]]
      const broadcast = Chalkboard.tens.mulHadamard([[1, 2], [3, 4]], [10, 100]); // Returns [[10, 200], [30, 400]]