Skip to content

RFC: unique* functions in lazy libraries: add size=None, fill_value=None #883

Open
@crusaderky

Description

@crusaderky

The functions

currently come with the disclaimer

The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See Data-dependent output shapes section for more details.

I propose to

  • Add two optional parameters size=None, fill_value=None, lifted from JAX
  • Change the disclaimer:
- Accordingly, such libraries may choose to omit this function.
+ Accordingly, such libraries may choose to require the size= parameter.

This not only helps with JAX and ndonnx interoperability, but also with Dask as it would allow to avoid NaN-sized arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionNeeds further discussion.RFCRequest for comments. Feature requests and proposed changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions