data-apis / array-api-compat

Compatibility layer for common array libraries to support the Array API
https://data-apis.org/array-api-compat/
MIT License
69 stars 22 forks source link

Provide a temporary implementation for `array_api.compat.torch.unique_all` instead of raising `NotImplementedError` #135

Open ogrisel opened 4 months ago

ogrisel commented 4 months ago

The first snippet provided in this comment https://github.com/pytorch/pytorch/issues/36748#issuecomment-1474368922 might help smooth support for torch in Array API consuming libraries such as scikit-learn without them having to maintain their own hacks while waiting upstream PyTorch to address https://github.com/pytorch/pytorch/issues/70920.

asmeurer commented 4 months ago

This sounds reasonable. Based on the code comments, the workarounds there didn't work because they used non-deterministic scatter. But if those workarounds you referenced don't have that issue, we can implement them.