index_complement#

iskra.sparse.index_complement(n: int, idx: Tensor) Tensor[SOURCE]#

Computes the complement of a set of linear indices.

Given a vector of linear indices idx into some other vector with n elements, the function returns a vector of indices which selects all elements of the vector not selected by idx.

Parameters:
  • n (int) – Total number of elements in a vector.

  • idx (Tensor) – Indices.

Returns:

(Tensor) – Vector of indices which select all elements not selected by idx.