• Unstacks a tf.Tensor of rank-R into a list of rank-(R-1) tf.Tensors.

    const a = tf.tensor2d([1, 2, 3, 4], [2, 2]);

    tf.unstack(a).forEach(tensor => tensor.print());

    Parameters

    • x: TensorLike | Tensor<Rank>

      A tensor object.

    • Optional axis: number

      The axis to unstack along. Defaults to 0 (the first dim).

    Returns Tensor[]

    Doc