Function split

  • Splits a tensor into sub tensors.

    Parameters

    • t: Tensor

      the input tensor

    • numOrSizeSplits: number | number[]

      either an integer indicating the number of splits along the axis or an array of integers containing the sizes of each output tensor along the axis. If a number then it must evenly divide the axis length; otherwise the sum of sizes must match axis length.

    • Optional axis: number

      (optional) the dimension along which to split

    Returns Tensor[]

    the split tensor