class_docstr: Gather slices from input ``x`` along dimension ``axis`` according to ``indices``, similar to ``tf.gather``.
  
  If ``indices`` is scalar (0-D):
  ``output[p_0, ..., p_{axis-1},            ,p_{axis+1}, ..., p_{rank(x)-1}]
  = x[p_0, ..., p_{axis-1}, indices, p_{axis+1}, ..., p_{rank(x)-1}]``
  where ``rank(x)`` is the rank of ``x``.
  
  The output has rank ``rank(x) - 1``.
  
  If indices is 1-D tensor:
  ``output[p_0, ..., p_{axis-1},            i, p_{axis+1}, ..., p_{rank(*D)-1}]
  = x[p_0, ..., p_{axis-1}, indices[i], p_{axis+1}, ..., p_{rank(*D)-1}]``.
  The output has rank ``rank(x)``.
  
  In general,
  ``output[p_0, ..., p_{axis-1},           i_0, ..., i_{M-1} , p_{axis+1}, ..., p_{rank(x)-1}]
  = x[p_0, ..., p_{axis-1}, indices[i_0, ..., i_{M-1}], p_{axis+1}, ..., p_{rank(x)-1}]``.
  
  where ``M = rank(x)``.
  
  Parameters
  ----------
  * x: tensor<*D,T> (Required)
  * indices: tensor<*N,i32> (Required)
      * Indices values may be negative. More precisely, ``-D[axis]<= v < D[axis]`` for ``v`` in ``indices``.
  * axis: const i32 (Optional)
      * Default to ``0``.
  
  Returns
  -------
  tensor<*K,T>
      * where ``K = D[:axis] + N + D[axis+1:]``.
  
  Attributes
  ----------
  T: fp32
code: def value_inference(self):
      x = self.x.sym_val
      indices = self.indices.val
      if indices is None:
          # only allow x to be symbolic. indices cannot.
          return None
      scalar_indices = isinstance(indices, numbers.Integral)
      axis = self.axis.val
      if scalar_indices:
          res = np.take(x, [indices], axis)
          res2 = np.squeeze(res, axis=axis)
          if isinstance(res2, np.ndarray) and len(res2.shape) == 0:
              # res2 is a scalar, but represented as np.array(symbol,
              # dtype=np.object) which np.squeeze can't remove.
              return res2.item()
          return res2
      return np.take(x, indices, axis)
  
imports: from coremltools.converters.mil.mil import SYMBOL, VALUE
  from coremltools.converters.mil.mil.types.symbolic import is_compatible_symbolic_vector
  from ._op_reqs import *
  import numbers
label_desc: Use image node_id 2 for calling the gather obj's underlying member method code with example usage: obj.value_inference() and returns: np, None, res2, res2