Skip to content

Remove MaxAndArgmax Op #334

Closed
Closed
@ricardoV94

Description

@ricardoV94

Description

This Composite Op computes both Max and Argmax and is returned by default when you call at.max(...).

This makes the graphs unnecessarily more complex from the get-go (see pymc-devs/pymc#6769).

In this specific case there's no loss of functionality because the implementation actually computes the two separately. I imagine an early algorithm computed the two at the same time, but they seemed to have switched to using Numpy max and argmax sequentially (both in python and c impl). Nope, the original one was already like that. Maybe it was useful in other backends (GPU?). Anyway, that's just guessing, and I don't see an obvious reason to start with MaxAndArgmax. If a more efficient impl can be obtained it could be added during specialization, not by default.

There's a mirror issue in Aesara: aesara-devs/aesara#765
And a draft PR: aesara-devs/aesara#874

class MaxAndArgmax(COp):

class Argmax(COp):

class Max(NonZeroDimsCAReduce):

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