Wraps a list of ArrayBuffers into a slice()-able object without allocating a large ArrayBuffer.

Allocating large ArrayBuffers (~2GB) can be unstable on Chrome. TFJS loads its weights as a list of (usually) 4MB ArrayBuffers and then slices the weight tensors out of them. For small models, it's safe to concatenate all the weight buffers into a single ArrayBuffer and then slice the weight tensors out of it, but for large models, a different approach is needed.

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optionalbuffers:
          | TypedArray
          | ArrayBuffer
          | ArrayBuffer[]
          | TypedArray[]

    Returns CompositeArrayBuffer

Properties

byteLength: number

Methods

  • Parameters

    • Optionalstart: number
    • Optionalend: number

    Returns ArrayBuffer

  • Concatenate a number of ArrayBuffers into one.

    Parameters

    • Optionalbuffers: ArrayBuffer | ArrayBuffer[]

      An array of ArrayBuffers to concatenate, or a single ArrayBuffer.

    Returns ArrayBuffer

    Result of concatenating buffers in order.