Indexing Routines

Generating index arrays

mars.tensor.nonzero
mars.tensor.where Return elements, either from x or y, depending on condition.
mars.tensor.indices Return a tensor representing the indices of a grid.
mars.tensor.ogrid Construct a multi-dimensional “meshgrid”.
mars.tensor.unravel_index

Indexing-like operations

mars.tensor.take
mars.tensor.choose
mars.tensor.compress
mars.tensor.diag Extract a diagonal or construct a diagonal tensor.