Table Of Contents
Table Of Contents

unravel_index

mxnet.ndarray.unravel_index(data=None, shape=_Null, out=None, name=None, **kwargs)

Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.

Examples:

A = [22,41,37]
unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]

Defined in src/operator/tensor/ravel.cc:L65

Parameters:
  • data (NDArray) – Array of flat indices
  • shape (Shape(tuple), optional, default=[]) – Shape of the array into which the multi-indices apply.
  • out (NDArray, optional) – The output NDArray to hold the result.
Returns:

out – The output of this function.

Return type:

NDArray or list of NDArrays