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 | None) – 每個批次中指定的元素數量

  • n_batch (int) – 批次維度的數量 (預設值:0)

  • n_dense (int) – 區塊維度的數量 (預設值:0)

  • index_dtype (DTypeLike) – 稀疏索引的 dtype (預設值:int32)

回傳:

矩陣的 BCOO 表示法。

回傳類型:

mat_bcoo