Skip to content

Commit

Permalink
Update readme (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityagoel4512 authored Oct 2, 2024
1 parent d185f2c commit 77e5c42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ It has a couple of key features:
```python
import numpy as np
import ndonnx as ndx
from jax.experimental import array_api as jxp
import jax.numpy as jnp

def mean_drop_outliers(a, low=-5, high=5):
xp = a.__array_namespace__()
return xp.mean(a[(low < a) & (a < high)])

np_result = mean_drop_outliers(np.asarray([-10, 0.5, 1, 5]))
jax_result = mean_drop_outliers(jxp.asarray([-10, 0.5, 1, 5]))
jax_result = mean_drop_outliers(jnp.asarray([-10, 0.5, 1, 5]))
onnx_result = mean_drop_outliers(ndx.asarray([-10, 0.5, 1, 5]))

assert np_result == onnx_result.to_numpy() == jax_result == 0.75
Expand Down

0 comments on commit 77e5c42

Please sign in to comment.