aesara.tensor.take#
- aesara.tensor.take(a, indices, axis=None, mode='raise')[source]#
Take elements from an array along an axis.
When axis is not None, this function does the same thing as “fancy” indexing (indexing arrays using arrays); however, it can be easier to use if you need elements along a given axis. A call such as
np.take(arr, indices, axis=3)
is equivalent toarr[:,:,:,indices,...]
.See
np.take
- Parameters:
a (TensorVariable) – The source array.
indices (TensorVariable, ndarray, list, tuple) – The indices of the values to extract.
axis (int, optional) – The axis over which to select values. By default, the flattened input array is used.