Skip to content

Switch Unique behavior from numpy < 2.0 to numpy >= 2.0Β #1739

@ricardoV94

Description

@ricardoV94

Description

The behavior changed regarding the shape of return_inverse. We patched our perform mode to behave like the old numpy, but we should change it now that we are only compatible with numpy 2.0

def perform(self, node, inputs, output_storage):
[x] = inputs
outs = old_np_unique(
x,
return_index=self.return_index,
return_inverse=self.return_inverse,
return_counts=self.return_counts,
axis=self.axis,
)
if isinstance(outs, tuple):
for i in range(len(outs)):
output_storage[i][0] = outs[i]
else:
output_storage[0][0] = outs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions