jax.experimental.sparse.bcoo_sum_duplicates#

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

对 BCOO 数组中的重复索引求和,返回一个具有排序索引的数组。

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

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

返回:

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

返回类型:

mat_out