gather

ivy.gather(params, indices, axis=- 1, dev_str=None, f=None)[source]

Gather slices from params axis axis according to indices.

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

  • indices (array) – Index array.

  • axis (int, optional) – The axis from which to gather from. Default is -1.

  • 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.

Returns

New array with the values gathered at the specified indices along the specified axis.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty