Skip to content

unique_all doesn't specify that indices should be a flattened index #588

@asmeurer

Description

@asmeurer

unique_all:

second element must have the field name indices and must be an array containing the indices (first occurrences) of x that result in values. The array must have the same shape as values and must have the default array index data type.

This is under specified because it isn't clear that the indices are for a flattened x, e.g.:

>>> import numpy.array_api as xp
<stdin>:1: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
>>> x = xp.asarray([[1, 0, 1], [0, 2, 1]])
>>> xp.unique_all(x)
UniqueAllResult(values=Array([0, 1, 2], dtype=int64), indices=Array([1, 0, 4], dtype=int64), inverse_indices=Array([[1, 0, 1],
       [0, 2, 1]], dtype=int64), counts=Array([2, 3, 1], dtype=int64))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy