Chalkboard - v3.1.0
    Preparing search index...

    Function sub

    • Calculates the subtraction 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.sub([[5, 8], [13, 21]], [[2, 3], [5, 8]]); // Returns [[3, 5], [8, 13]]
      const broadcast = Chalkboard.tens.sub([10], [[1], [2]]); // Returns [[9], [8]]