Chalkboard - v3.1.0
    Preparing search index...

    Function reshape

    • Returns a tensor with the same entries in row-major order but a different shape, which must have the same size (unlike resize, which truncates or pads with zeros).

      Parameters

      • tens: ChalkboardTensor

        The tensor

      • ...shape: number[]

        The shape to change to, either as a sequence of arguments or one array

      Returns ChalkboardTensor

      const result = Chalkboard.tens.reshape([1, 2, 3, 4, 5, 6], 2, 3); // Returns [[1, 2, 3], [4, 5, 6]]