Skip to content

Commit

Permalink
refactor(jax-frontend): Refactored fmin and fmax to use native iv…
Browse files Browse the repository at this point in the history
…y functions (ivy-llc#27358)
  • Loading branch information
mobley-trent authored Nov 20, 2023
1 parent f5c75e9 commit f944f05
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions ivy/functional/frontends/jax/numpy/mathematical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,24 +452,13 @@ def floor_divide(x1, x2, /, out=None):
@to_ivy_arrays_and_back
def fmax(x1, x2):
x1, x2 = promote_types_of_jax_inputs(x1, x2)
ret = ivy.where(
ivy.bitwise_or(ivy.greater(x1, x2), ivy.isnan(x2)),
x1,
x2,
)
return ret
return ivy.fmax(x1, x2)


@to_ivy_arrays_and_back
def fmin(x1, x2):
x1, x2 = promote_types_of_jax_inputs(x1, x2)
ret = ivy.where(
ivy.bitwise_or(ivy.less(x1, x2), ivy.isnan(x2)),
x1,
x2,
)
print("jax-frontend", ret)
return ret
return ivy.fmin(x1, x2)


@to_ivy_arrays_and_back
Expand Down

0 comments on commit f944f05

Please sign in to comment.