tf.keras.ops.unravel_index
Stay organized with collections
Save and categorize content based on your preferences.
Convert flat indices to coordinate arrays in a given array shape.
tf.keras.ops.unravel_index(
indices, shape
)
Args |
indices
|
An integer or array of integers representing flat indices.
|
shape
|
The shape of the array to unravel into.
|
Returns |
|
Tuple of arrays for each dimension with unraveled indices.
|
Example:
indices = 5
shape = (3, 3)
unravel_index(indices, shape)
(1, 2) # 5 is at row 1, column 2 in a 3x3 array
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 2026-10-31 UTC.
[null,null,["Last updated 2026-10-31 UTC."],[],[]]