Skip to content

Array comparison operators/functions #1431

Open
@Qazalbash

Description

@Qazalbash

Hi,

I come from a Python background. I have used numpy for array-based computing and recently started working on JAX. They have very easy-to-use array comparison functions 123 to check the relative, partial order etc. I find a lack of these functions/operators here. It would be a great enhancement and would help in testing code without writing a bunch of lines to compare errors or check the relationship between two arrays.

Until now I have been doing things like this,

assert!(distance.iter().all(|&d| d >= -ERR_MARGIN));

With the feature, it should more or less look like this,

assert!(distance.geq(-ERR_MARGIN));

Footnotes

  1. jax.numpy.allclose

  2. jax.numpy.isclose

  3. jax.numpy.equal

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