class_docstr: Select elements stored in given indices.
class_docstr_tok: ["Select","elements","stored","in","given","indices","."]
code: def forward(self, inputs):
      self.retain_inputs((1,))
      x, t = inputs
      self._in_shape = x.shape
      self._in_dtype = x.dtype
      if chainer.is_debug():
          if not ((0 <= t).all() and (t < x.shape[1]).all()):
              msg = "Each label `t` need to satisfty `0 <= t < x.shape[1]`"
              raise ValueError(msg)
  
      xp = backend.get_array_module(x)
      if xp is numpy:
          # This code is equivalent to `t.choose(x.T)`, but `numpy.choose`
          # does not work when `x.shape[1] > 32`.
          return (x[six.moves.range(t.size), t],)
      else:
          y = cuda.elementwise(
              "S t, raw T x",
              "T y",
              "int ind[] = {i, t}; y = x[ind];",
              "getitem_fwd",
          )(t, x)
          return (y,)
  
file_path: chainer/chainer/functions/array/select_item.py
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the SelectItem obj's underlying member method code with example usage: obj.forward(inputs) and returns: x, y