jax-js
    Preparing search index...

    Function diagIndices

    • Return the indices to access the main diagonal of an array.

      This returns a list of ndim index arrays, each holding [0, 1, ..., n-1]. They can be used with advanced indexing to access the main diagonal of an array with ndim dimensions, each of length n.

      Parameters

      • n: number
      • ndim: number = 2

      Returns Array[]