jax-js
    Preparing search index...

    Function indices

    • Return an array representing the indices of a grid.

      Computes an array where the subarrays contain index values 0, 1, … varying only along the corresponding axis. The result has shape [dimensions.length, ...dimensions].

      If sparse is set, returns one array per dimension instead, each with shape 1 in all dimensions except its own.

      Parameters

      • dimensions: number[]
      • Optionalopts: { device?: Device; dtype?: DType } & { sparse?: false }

      Returns Array

    • Return an array representing the indices of a grid.

      Computes an array where the subarrays contain index values 0, 1, … varying only along the corresponding axis. The result has shape [dimensions.length, ...dimensions].

      If sparse is set, returns one array per dimension instead, each with shape 1 in all dimensions except its own.

      Parameters

      • dimensions: number[]
      • opts: { device?: Device; dtype?: DType } & { sparse: true }

      Returns Array[]

    • Return an array representing the indices of a grid.

      Computes an array where the subarrays contain index values 0, 1, … varying only along the corresponding axis. The result has shape [dimensions.length, ...dimensions].

      If sparse is set, returns one array per dimension instead, each with shape 1 in all dimensions except its own.

      Parameters

      • dimensions: number[]
      • opts: { device?: Device; dtype?: DType } & { sparse: boolean }

      Returns Array | Array[]