tensorflow_mri.unravel_index

unravel_index(indices, dims)[source]

Converts an array of flat indices into an array of multi-indices.

Parameters
  • indices – A Tensor of shape [...] containing flat indices into an N-dimensional tensor.

  • dims – A Tensor of shape [N]. The shape of the tensor that indices indexes into.

Returns

A Tensor of shape [..., N] containing multi-indices equivalent to flat indices.