Chalkboard - v3.1.0
    Preparing search index...

    Function add

    • Calculates the addition 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.add([[1, 2], [3, 4]], [[4, 3], [2, 1]]); // Returns [[5, 5], [5, 5]]
      const broadcast = Chalkboard.tens.add([[1, 2, 3], [4, 5, 6]], [10, 20, 30]); // Returns [[11, 22, 33], [14, 25, 36]]