mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 10:26:56 +08:00
Adds isinf (#445)
* adds isinf Signed-off-by: matthewfernst <matthew.f.ernst@gmail.com> * use stream + nits * typo --------- Signed-off-by: matthewfernst <matthew.f.ernst@gmail.com> Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
@@ -1084,6 +1084,10 @@ array isnan(const array& a, StreamOrDevice s /* = {} */) {
|
||||
return not_equal(a, a, s);
|
||||
}
|
||||
|
||||
array isinf(const array& a, StreamOrDevice s /* = {} */) {
|
||||
return equal(a, array(std::numeric_limits<float>::infinity(), a.dtype()), s);
|
||||
}
|
||||
|
||||
array where(
|
||||
const array& condition,
|
||||
const array& x,
|
||||
|
@@ -378,6 +378,8 @@ array_equal(const array& a, const array& b, StreamOrDevice s = {}) {
|
||||
|
||||
array isnan(const array& a, StreamOrDevice s = {});
|
||||
|
||||
array isinf(const array& a, StreamOrDevice s = {});
|
||||
|
||||
/** Select from x or y depending on condition. */
|
||||
array where(
|
||||
const array& condition,
|
||||
|
Reference in New Issue
Block a user