Chalkboard - v3.1.0
    Preparing search index...

    Function slice

    • Returns a tensor sliced along leading axes.

      Parameters

      • tens: ChalkboardTensor

        The tensor

      • ...ranges: [number, number][]

        At most rank [start, end] pairs, as a sequence or one array of pairs, with non-negative integer bounds and an exclusive end

      Returns ChalkboardTensor

      const result = Chalkboard.tens.slice([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], [1, 3], [0, 2]); // Returns [[5, 6], [9, 10]]