aesara.tensor.unravel_index

Contents

aesara.tensor.unravel_index#

aesara.tensor.unravel_index(indices, dims, order='C')[source]#

Converts a flat index or array of flat indices into a tuple of coordinate arrays.

Parameters:
  • indices (Aesara or NumPy array) – An integer array whose elements are indices into the flattened version of an array of dimensions dims.

  • dims (tuple of ints) – The shape of the array to use for unraveling indices.

  • order ({'C', 'F'}, optional) – Determines whether the indices should be viewed as indexing in row-major (C-style) or column-major (Fortran-style) order.

Returns:

unraveled_coords – Each array in the tuple has the same shape as the indices array.

Return type:

tuple of ndarray