jax.experimental.sparse.csr_fromdense#

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

从稠密矩阵创建 CSR 格式的稀疏矩阵。

参数
  • mat (Array) – 要转换为 CSR 的数组。

  • nse (int | None | None) – mat 中指定的条目数。如果未指定,将从输入矩阵计算。

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

返回

矩阵的 CSR 表示形式。

返回类型

mat_coo