ivy.gather_nd(params: ivy.NativeArray, indices: ivy.NativeArray, dev_str: Optional[str] = None, f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

Gather slices from params into a array with shape specified by indices.

  • params (array) – The array from which to gather values.

  • indices (array) – Index array.

  • dev_str (str, optional) – device on which to create the array ‘cuda:0’, ‘cuda:1’, ‘cpu’ etc. Same as x if None.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


New array of given shape, with the values gathered at the indices.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty