Chalkboard - v3.0.4
    Preparing search index...

    Function toTensor

    • Converts an array to a tensor.

      Parameters

      • arr: number[]

        The array

      • ...size: number[]

        The size of the tensor

      Returns ChalkboardTensor

      const result = Chalkboard.stat.toTensor([1, 2, 3, 4], 2, 2); // Returns [[1, 2], [3, 4]]