jax.experimental.sparse.bcoo_fromdense#

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

从密集矩阵创建 BCOO 格式的稀疏矩阵。

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

  • nse (int | None) – 每个批次中指定元素的数量

  • n_batch (int) – 批次维度数量 (默认值: 0)

  • n_dense (int) – 块维度数量 (默认值: 0)

  • index_dtype (DTypeLike) – 稀疏索引的数据类型 (默认值: int32)

返回:

矩阵的 BCOO 表示。

返回类型:

mat_bcoo