cr.sparse.vec_unit_jit

cr.sparse.vec_unit_jit(n, i)

Returns a unit vector in i-th dimension for the standard coordinate system

Parameters
  • n (int) – Length of the vector.

  • i (int) – Index/dimension of the unit vector.

Returns

A line vector of length n with all zeros except a one at position i.

Return type

jax.numpy.ndarray