tf.keras.ops.unstack  |  TensorFlow v2.16.1 (original) (raw)

tf.keras.ops.unstack

Unpacks the given dimension of a rank-R tensor into rank-(R-1) tensors.

tf.keras.ops.unstack(
    x, num=None, axis=0
)
Args
x The input tensor.
num The length of the dimension axis. Automatically inferred if None.
axis The axis along which to unpack.
Returns
A list of tensors unpacked along the given axis.

Example:

x = keras.ops.array([[1, 2], [3, 4]]) keras.ops.unstack(x, axis=0) [array([1, 2]), array([3, 4])]

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-06-07 UTC.