docstr: ivy.Array instance method variant of ivy.gather. This method simply
  wraps the function, and so the docstring for ivy.gather also applies to
  this method with minimal changes.
  
  Parameters
  ----------
  self
      The array from which to gather values.
  indices
      The array which indicates the indices that will be gathered along
      the specified axis.
  axis
      The axis from which the indices will be gathered. Default is ``-1``.
  batch_dims
      Optional int, lets you gather different items from each element of a batch.
      Default is ``0``.
  out
      Optional array, for writing the result to. It must have a shape
      that the inputs broadcast to.
  
  Returns
  -------
  ret
      New array with the values gathered at the specified indices along
      the specified axis.
  
  Examples
  --------
  >>> x = ivy.array([0., 1., 2.])
  >>> y = ivy.array([0, 1])
  >>> gather = x.gather(y)
  >>> print(gather)
  ivy.array([0., 1.])
  
  >>> x = ivy.array([[0., 1., 2.],[3., 4., 5.]])
  >>> y = ivy.array([[0, 1],[1, 2]])
  >>> z = ivy.zeros((2, 2, 2))
  >>> gather = x.gather(y, out=z)
  >>> print(z)
  ivy.array([[[0., 1.],[1., 2.]],[[3., 4.],[4., 5.]]])
  
  >>> x = ivy.array([[[0., 1.], [2., 3.]],
  ...                [[8., 9.], [10., 11.]]])
  >>> y = ivy.array([[0, 1]])
  >>> z = ivy.zeros((1, 2, 2, 2))
  >>> gather = x.gather(y, axis=0, out=z)
  >>> print(z)
  ivy.array(
      [[[[ 0.,  1.],
      [ 2.,  3.]],
      [[ 8.,  9.],
      [10., 11.]]]])
  
  >>> x = ivy.array([[0, 10, 20, 0, 0],
  ...                [0, 0, 0, 30, 40],
  ...                [0, 10, 0, 0, 40]])
  >>> y = ivy.array([[1, 2],[3, 4],[1, 4]])
  >>> gather = x.gather(y, batch_dims=1)
  >>> print(gather)
  ivy.array([[10, 20], [30, 40],[10, 40]])
docstr_tok: ["ivy.Array","instance","method","variant","of","ivy.gather",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","ivy.gather","also","applies","to","this","method","with","minimal","changes",".","Parameters","--","--","--","--","--","self","The","array","from","which","to","gather","values",".","indices","The","array","which","indicates","the","indices","that","will","be","gathered","along","the","specified","axis",".","axis","The","axis","from","which","the","indices","will","be","gathered",".","Default","is","``","-1","``",".","batch_dims","Optional","int",",","lets","you","gather","different","items","from","each","element","of","a","batch",".","Default","is","``","0","``",".","out","Optional","array",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","New","array","with","the","values","gathered","at","the","specified","indices","along","the","specified","axis",".","Examples","--","--","--","--",">",">",">","x","=","ivy.array","(","[","0.",",","1.",",","2",".","]",")",">",">",">","y","=","ivy.array","(","[","0",",","1","]",")",">",">",">","gather","=","x.gather","(","y",")",">",">",">","print","(","gather",")","ivy.array","(","[","0.",",","1",".","]",")",">",">",">","x","=","ivy.array","(","[","[","0.",",","1.",",","2",".","]",",","[","3.",",","4.",",","5",".","]","]",")",">",">",">","y","=","ivy.array","(","[","[","0",",","1","]",",","[","1",",","2","]","]",")",">",">",">","z","=","ivy.zeros","(","(","2",",","2",",","2",")",")",">",">",">","gather","=","x.gather","(","y",",","out=z",")",">",">",">","print","(","z",")","ivy.array","(","[","[","[","0.",",","1",".","]",",","[","1.",",","2",".","]","]",",","[","[","3.",",","4",".","]",",","[","4.",",","5",".","]","]","]",")",">",">",">","x","=","ivy.array","(","[","[","[","0.",",","1",".","]",",","[","2.",",","3",".","]","]",",","...","[","[","8.",",","9",".","]",",","[","10.",",","11",".","]","]","]",")",">",">",">","y","=","ivy.array","(","[","[","0",",","1","]","]",")",">",">",">","z","=","ivy.zeros","(","(","1",",","2",",","2",",","2",")",")",">",">",">","gather","=","x.gather","(","y",",","axis=0",",","out=z",")",">",">",">","print","(","z",")","ivy.array","(","[","[","[","[","0.",",","1",".","]",",","[","2.",",","3",".","]","]",",","[","[","8.",",","9",".","]",",","[","10.",",","11",".","]","]","]","]",")",">",">",">","x","=","ivy.array","(","[","[","0",",","10",",","20",",","0",",","0","]",",","...","[","0",",","0",",","0",",","30",",","40","]",",","...","[","0",",","10",",","0",",","0",",","40","]","]",")",">",">",">","y","=","ivy.array","(","[","[","1",",","2","]",",","[","3",",","4","]",",","[","1",",","4","]","]",")",">",">",">","gather","=","x.gather","(","y",",","batch_dims=1",")",">",">",">","print","(","gather",")","ivy.array","(","[","[","10",",","20","]",",","[","30",",","40","]",",","[","10",",","40","]","]",")"]
code: def gather(
      self: ivy.Array,
      indices: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: int = -1,
      batch_dims: int = 0,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """ivy.Array instance method variant of ivy.gather. This method simply
      wraps the function, and so the docstring for ivy.gather also applies to
      this method with minimal changes.
  
      Parameters
      ----------
      self
          The array from which to gather values.
      indices
          The array which indicates the indices that will be gathered along
          the specified axis.
      axis
          The axis from which the indices will be gathered. Default is ``-1``.
      batch_dims
          Optional int, lets you gather different items from each element of a batch.
          Default is ``0``.
      out
          Optional array, for writing the result to. It must have a shape
          that the inputs broadcast to.
  
      Returns
      -------
      ret
          New array with the values gathered at the specified indices along
          the specified axis.
  
      Examples
      --------
      >>> x = ivy.array([0., 1., 2.])
      >>> y = ivy.array([0, 1])
      >>> gather = x.gather(y)
      >>> print(gather)
      ivy.array([0., 1.])
  
      >>> x = ivy.array([[0., 1., 2.],[3., 4., 5.]])
      >>> y = ivy.array([[0, 1],[1, 2]])
      >>> z = ivy.zeros((2, 2, 2))
      >>> gather = x.gather(y, out=z)
      >>> print(z)
      ivy.array([[[0., 1.],[1., 2.]],[[3., 4.],[4., 5.]]])
  
      >>> x = ivy.array([[[0., 1.], [2., 3.]],
      ...                [[8., 9.], [10., 11.]]])
      >>> y = ivy.array([[0, 1]])
      >>> z = ivy.zeros((1, 2, 2, 2))
      >>> gather = x.gather(y, axis=0, out=z)
      >>> print(z)
      ivy.array(
          [[[[ 0.,  1.],
          [ 2.,  3.]],
          [[ 8.,  9.],
          [10., 11.]]]])
  
      >>> x = ivy.array([[0, 10, 20, 0, 0],
      ...                [0, 0, 0, 30, 40],
      ...                [0, 10, 0, 0, 40]])
      >>> y = ivy.array([[1, 2],[3, 4],[1, 4]])
      >>> gather = x.gather(y, batch_dims=1)
      >>> print(gather)
      ivy.array([[10, 20], [30, 40],[10, 40]])
      """
      return ivy.gather(
          self, indices, axis=axis, batch_dims=batch_dims, out=out
      )
  
imports: import abc
  import numpy
  from numbers import Number
  from typing import Any, Iterable, Union, Optional, Dict, Callable, List, Tuple
  import ivy
label_desc: Use image node_id 7 for calling the _ArrayWithGeneral obj's underlying member method code with example usage: obj.gather() and returns: ivy