array-api icon indicating copy to clipboard operation
array-api copied to clipboard

RFC: add bincount

Open ogrisel opened this issue 8 months ago • 5 comments

It seems quite widely adopted:

  • https://numpy.org/doc/stable/reference/generated/numpy.bincount.html
  • https://pytorch.org/docs/stable/generated/torch.bincount.html
  • https://docs.cupy.dev/en/stable/reference/generated/cupy.bincount.html
  • https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.bincount.html
  • https://docs.dask.org/en/stable/generated/dask.array.bincount.html

Although I have not checked how compatible they are.

JAX in particular requires an extra length argument to statically define the length of the output array to make JIT possible and dask uses (nan,) shape to represent a data-dependent output shapes.

ogrisel avatar Jun 05 '24 15:06 ogrisel