Chalkboard - v3.0.4
    Preparing search index...

    Function toTensor

    • Converts a matrix to a tensor.

      Parameters

      • matr: ChalkboardMatrix

        The matrix

      • ...size: number[]

        The number of rows, columns, tubes, etc. of the tensor 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