Skip to content

Implement numpy.clip() #334

Open
Open
@certik

Description

@certik

This is a good function to implement fully in LPython. It works for:

  • any type
  • any array rank and some combination of ranks
  • it automatically broadcasts

If we can fully implement this as regular LPython code, without any extra "clip specific" logic in AST2ASR, this will be enough to implement large parts of NumPy.

So we can use this function as a "testbed", and implement all missing features in LPython.

I suggest we try to implement some small subset, then we try to make the function work for more combination of types and ranks, then we try to implement some generalizations in LPython to make this easier, such as "generics" (any type) and rank agnostic generics, to make the code simpler, and iteratively improve, until this function can be implemented relatively easily.

See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    numpyBugs and feature requests regarding NumPy support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions