Chalkboard - v3.1.0
    Preparing search index...

    Function toTensor

    • Converts a matrix to a tensor.

      Parameters

      • matr: ChalkboardMatrix

        The matrix

      • ...shape: number[]

        The shape of the tensor, as the lengths of its axes, represented as a single array or a sequence of arguments

      Returns ChalkboardTensor

      const result = Chalkboard.matr.toTensor([[1, 2], [3, 4]], 2, 2); // Returns an equivalent rank-2 tensor