8000 The definition and discussion around "default array index data type" is missing · Issue #319 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content
The definition and discussion around "default array index data type" is missing #319
Closed
@leofang

Description

@leofang

The context is when returning indices and/or counts of array elements the unique_*() APIs may have to promote the data type of the returned array (=default integer type) depending on the situation, so they should have been using "default array index data type" instead.

IIUC the term "default array index data type" is still referred to by some functions like argsort(), but

Copying @kgryte from #317 (comment):

Originally, when writing the unique specification, the output dtype was the "default index data type". I wonder if we need to revive that distinction. Namely, that an array library should have three default data types:

  1. floating-point data type
  2. integer data type
  3. index data type

Here, having a default index data type makes sense, as counts should align accordingly (i.e., a count should never exceed the maximum array index).

Furthermore, while it may often be the case that indices will have the same dtype as the default integer dtype, this need not be the case. For example, indices may be int64, while the default integer dtype could be int32 due to better target hardware support (e.g., GPUs).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0