jax.experimental.sparse.csr_fromdense#

jax.experimental.sparse.csr_fromdense(mat, *, nse=None, index_dtype=<class 'numpy.int32'>)[source]#

從密集矩陣建立 CSR 格式的稀疏矩陣。

參數:
  • mat (Array) – 要轉換為 CSR 的陣列。

  • nse (int | None | None) – mat 中指定的條目數。如果未指定,將從輸入矩陣計算。

  • index_dtype (DTypeLike) – 稀疏索引的 dtype

回傳:

矩陣的 CSR 表示法。

回傳類型:

mat_coo