Class Packer

Class which can pack multiple values which may have multiple dimensions into a one-dimensional array of values, and unpack them again.

Constructors

Accessors

Methods

Constructors

Accessors

  • get length(): number

    Returns the total number of values which will be held in a one-dimensional array after packing by this Packer.

    Returns number

Methods

  • Unpacks a one-dimensional array to the shapes defined by this Packer.

    Parameters

    • x: number[]

      A standard number array

    Returns UnpackResult

  • Unpacks an NdArray to the shapes defined by this Packer. We require the first dimension in the NdArray to equal length. Any additional dimensions are added to the configured shapes for each unpacked value.

    Parameters

    • x: NdArray

      NdArray of numbers

    Returns UnpackResult