chainer.functions.get_item

chainer.functions.get_item(x, slices)[source]

Extract elements from array with specified shape, axes and offsets.

Parameters:
  • x (Variable) – A variable to be sliced.
  • slices (int, slice, Ellipsis, None, integer array-like, boolean array-like or tuple of them) – It is an integer, a slice, an ellipsis, a numpy.newaxis, an integer array-like, a boolean array-like or tuple of them.
Returns:

A Variable object which contains sliced array of x.

Note

It only supports types that are supported by CUDA’s atomicAdd when an integer array is included in slices. The supported types are numpy.float32, numpy.int32, numpy.uint32, numpy.uint64 and numpy.ulonglong.

Note

It does not support slices that contains multiple boolean arrays.

Note

See NumPy document for details of indexing.