jax.experimental.sparse.bcoo_sum_duplicates#

jax.experimental.sparse.bcoo_sum_duplicates(mat, nse=None)[源代码]#

汇总 BCOO 数组中的重复索引,返回一个具有排序索引的数组。

参数:
  • mat (BCOO) – BCOO 数组

  • nse (int | None) – 整数(可选)。输出矩阵中指定元素的数量。必须指定此参数,以便 bcoo_sum_duplicates 与 JIT 和其他 JAX 转换兼容。如果未指定,将根据数据和索引数组的内容计算最佳 nse。如果指定的 nse 大于必要值,数据和索引数组将用标准填充值进行填充。如果小于必要值,数据元素将从输出矩阵中删除。

返回:

具有排序索引且无重复索引的 BCOO 数组。

返回类型:

mat_out