take#
Fully qualified name: isaacsim::common::array::take
- Array isaacsim::common::array::take(
- const Array &a,
- const std::vector<int64_t> &indices,
- const std::optional<int64_t> &axis = std::nullopt,
Gathers elements along a single axis by index.
Selects the positions listed in
indicesalongaxis, so the result has the operand’s shape with that axis resized toindices.size(). Whenaxisis omitted the operand is flattened first and the result is 1-D. Negative entries inindicescount from the end of the axis, and a negativeaxiscounts from the last axis. Indices may repeat, which duplicates elements, and may be empty, which produces a zero-sized axis. A 0-D operand is treated as 1-D of size 1 whether or not an axis is given. The result keeps the operand’s dtype and device, and holds a copy rather than a view of the elements.- Parameters:
a – [in] Operand.
indices – [in] Positions to gather along
axis.axis – [in] Axis to gather along, or
std::nulloptto gather from the flattened operand.
- Throws:
- Returns:
A new Array holding the gathered elements.