class_docstr: Take the values along ``axis`` at locations ``indices``.
  
  .. math::
     idx = indices[p_0, ..., p_{axis-1}, i, p_{axis+1}, ..., p_D]
  .. math::
     output[p_0, ..., p_{axis-1}, i, p_{axis+1}, ..., p_D] = = x[p_0, ..., p_{axis-1}, idx, p_{axis+1}, ..., p_D]
  
  Parameters
  ----------
  x: tensor<\*D, T> (Required)
  indices: tensor<\*K, i32> (Required)
      * ``rank(indices) == rank(x)``.
  axis: const i32 (Optional):
      * Default to ``0``.
  
  Returns
  -------
  tensor<\*D, T>:
      * Output tensor has the same shape as ``indices``.
  
  Attributes
  ----------
  T: fp16, fp32, i32
class_docstr_tok: ["Take","the","values","along","``","axis","``","at","locations","``","indices","``",".","..","math",":",":","idx","=","indices","[","p_0",",","...",",","p_","{","axis-1","}",",","i",",","p_","{","axis+1","}",",","...",",","p_D","]","..","math",":",":","output","[","p_0",",","...",",","p_","{","axis-1","}",",","i",",","p_","{","axis+1","}",",","...",",","p_D","]","=","=","x","[","p_0",",","...",",","p_","{","axis-1","}",",","idx",",","p_","{","axis+1","}",",","...",",","p_D","]","Parameters","--","--","--","--","--","x",":","tensor","<","\\","*","D",",","T",">","(","Required",")","indices",":","tensor","<","\\","*","K",",","i32",">","(","Required",")","*","``","rank","(","indices",")","==","rank","(","x",")","``",".","axis",":","const","i32","(","Optional",")",":","*","Default","to","``","0","``",".","Returns","--","--","--","-","tensor","<","\\","*","D",",","T",">",":","*","Output","tensor","has","the","same","shape","as","``","indices","``",".","Attributes","--","--","--","--","--","T",":","fp16",",","fp32",",","i32"]
code: def type_inference(self):
      if self.x.rank != self.indices.rank:
          raise ValueError(
              "Rank mismatch between input and indices. \
                                Input rank: {}, indices rank: {}".format(
                  self.x.rank, self.indices.rank
              )
          )
  
      if self.axis.val < -self.x.rank or self.axis.val >= self.x.rank:
          raise IndexError(
              "Axis value {} is out of bounds for {} node {}".format(
                  self.axis.val, self.op_type, self.name
              )
          )
  
      axis = self.axis.val
      axis = axis if axis >= 0 else axis + self.x.rank
  
      for i in range(self.x.rank):
          if i != axis:
              assert self.x.shape[i] == self.indices.shape[i]
  
      return types.tensor(self.x.dtype, self.indices.shape)
  
imports: import numpy
  from coremltools.converters.mil.mil import Operation, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.operation import SYMBOL, VALUE, precondition
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs._utils import compute_gather
  from coremltools.converters.mil.mil.types.symbolic import is_compatible_symbolic_vector
label_desc: Use image node_id 3 for calling the gather_along_axis obj's underlying member method code with example usage: obj.type_inference() and returns: types