tensorflow_mri.ravel_multi_index

ravel_multi_index(multi_indices, dims)[source]

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

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

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

Returns

A Tensor of shape [...] containing flat indices equivalent to multi_indices.